View Single Post
  #8 (permalink)  
Old July 4th, 2004, 02:52 PM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

Something else painfully obvious that just occured to me is make sure that you have cookies enabled in your browser. For the session data to persist the session id must be passed between the scripts, this is done with cookies by default.

In Mozilla:
Edit->Preferences->Privacy & Security ->Cookies->Allow Cookies Based On Privacy Settings->View->Allow First Party Cookies->OK

In Internet Exploder:
Tools->Internet Options->Privacy->Advanced->Override Automatic Cookie Handling->Accept First Party Cookies->Block third-party cookies->Always allow session cookies -> OK

Most people also hard code the session id into the url so that cookies don't have to be enabled.
    echo "<a href='http://localhost/moviesite.php?favmovie=$myfavmovie&amp;PHPSESSID=" .session_id()."'>";

What I just did here can also be done via the session.use_trans_sid directive in php.ini and PHP will automagically insert the session id in all urls on the page as well as in all forms as a hidden field.


The Spicy Peanut Project