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