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
https://forums.phpfreaks.com/topic/60076-session-security-issues/
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

<?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.

 

}

 

?>

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.