Jump to content
Larry Ullman's Book Forums

Chapter 9 - Accessing Session Variables


Recommended Posts

What debugging steps have you taken so far? What versions of PHP and MySQL are you running?

 

Things to consider are:

 

1) Are you logging in from http://domain.com and being redirected to http://www.domain.com? If so it's classed as a new domain and a new session will be started. Could check this also by echo'ing out sessIon_id() on both pages.

 

2) Try using print_r($_SESSION) to see what data is being stored, if any.

 

Also in general you should check the index exists using isset() first before trying to access a variable.

 

Let us know how you get on - and post more detail so we can give better help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...