Re: Session-problem
| From: | Kjetil Limkjaer | Date: | Fri, 24 Nov 2000 13:07:18 +0000 |
| Subject: | Re: Session-problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26950@lists.php.net to get a copy of this message | ||
Bjorn Andre Lie - LightWare ans wrote this on 24-11-2000:
BALLa> session_start();
BALLa> $ses_basket_id = $PHPSESSID;
BALLa> session_register("ses_basket_id");
BALLa> Problem :
BALLa> When I load the script into the browser (IE5.5) the session_ID is not
BALLa> stored in the coockie. When I reload the page the Session_ID is stored and
BALLa> everything is working fine. Should it be like this? To solve the problem,
BALLa> my script reloads itself until the session_ID is OK - no a good soloution I
BALLa> believe.
In PHP4.0.3 onwards, the track_vars configuration option is on by
default. Because of this you have to register the variable using:
session_register("ses_basket_id");
$HTTP_SESSION_VARS["ses_basket_id"] = $PHPSESSID;
To revert this to the old method, where your example would work, turn
track_vars off. Personally I like the track_vars enabled method
better, it prevents me from accidentally storing something in a
session variable :)
Kindest regards,
Kjetil
--
"Monday is an awful way to spend one-seventh of your life."
| OMNIS/PHP/SQL Developer for FIQAS Software, Aalsmeer, The Netherlands. |
} If I had an opinion in this message, it's probably my own. {