Session information Error??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rob_Beard
Forum Newbie
Posts: 23
Joined: Sat Oct 12, 2002 11:58 am

Session information Error??

Post by Rob_Beard »

Hey all,

I'm having a few problems, my host is using php 4.2.1, on Apache.

Anyway, My admin panel which i'm building requires the admin username which is stored inside the session cookie on the server. However, as soon as my system goes from the validation.php page to the admin.php page, it doesnt recognise the session cookie as containing any data, but yet

session_start();
if (isset($_SESSION["username"]))

still allows them to view the page, rather than sending them back to the login screen?

Any ideas?

thanks,
Rob
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

echo your Session

echo "<pre>";
print_r($_SESSION);
echo "</pre>";


how are you setting your session?
Rob_Beard
Forum Newbie
Posts: 23
Joined: Sat Oct 12, 2002 11:58 am

Post by Rob_Beard »

Thanks for replying, but i got it sorted now, I just declared the session value as a seperate variable at the top of each page.
Post Reply