Jump to content

Solved (but dont ask) Session Help - Should be easy


willpower

Recommended Posts

Hi

Imagine that the user logs in with username and password and this is checked for validity in 'check_user.php'.  Once vaildated this file stores the data in $_SESSION['user']=$username and redirects the user back to the referring page.

If the session in set/registered the referring page now displays the users shopping cart. and log on message " You are logged in as $SESSION['user'];

With me so far.

This all works...wey hey.

But when I refresh this page or navigate to another....gues what happens.

NO they arent asked to log in again....but the displayed username (the session var) changes from the username to "0"

WHY.....

I can post code but as there is a lot I wondered if anyone has had a similar issue first or can give me some poinetsr to check.

session_start() is included in all files.
why would it change on a page refresh?

thanks

Will

When validated an include 'shopping

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.