Jump to content

SESSION security issues


Foser

Recommended Posts

<?php
if ($_SESSION['LOGGEDIN'] != TRUE){
echo "You are not logged in. Click <a href=\"../index.php\">here</a> to login."; exit;}

?>

 

I have this at the top of my member page and i wanted to make a session page to i required this again for that page. but for this page this executes...  but when i go back to member page i have no problem. :S any ideas?

Link to comment
Share on other sites

read up on included custom library construction.  This is what I do not required for every

at the  top of each page (pre any headers I have)

<?php
require_once(requires.php);
?>

Requires is a file that distributes the rest of the includes based on which page you are on.  That way you can update al pages easily through this

Link to comment
Share on other sites

<?php
if ($_SESSION['LOGGEDIN'] != TRUE){
echo "You are not logged in. Click <a href=\"../index.php\">here</a> to login."; exit;}

?>

 

I have this at the top of my member page and i wanted to make a session page to i required this again for that page. but for this page this executes...  but when i go back to member page i have no problem. :S any ideas?

 

Try this

 

<?php

 

if(!$_SESSION['LOGGEDIN']){

echo "You are not logged in. Click <a href=\"../index.php\">here</a> to login.";

 

} else {

 

member only content here.

 

}

 

?>

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.