Re: Sessions just don't work on my machine. (Trying this ag ain)

From: Date: Tue, 25 Sep 2001 09:35:03 +0000
Subject: Re: Sessions just don't work on my machine. (Trying this ag ain)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-68672@lists.php.net to get a copy of this message
On Monday 24 September 2001 21:23, Thomas Deliduka wrote: > I just tried this here below. Before trying this I changed any > called to $PHPSESSID to session_id(). > > I turned off cookies > Loaded the page... Created session id and file: > sess_44074d3a54862b480c3407c9eb373f77 > Contents: var1|s:8:"My var 1";var2|s:8:"My var 2"; > > I submitted the form: If you used the yesterday's code, then you it really doesn't work with turned off cookies. You have to pass the SID from page to page in order to keep the session: <FORM ACTION="index2.php?<?=SID?>" METHOD="POST"> > PHPsessionid shows up as: 2f633e17c6752342d0c1e7e6191b4112 > New file with same name contents: var3|s:8:"My Var 3"; > I removed index2.php and went back to the first file. > PHP SessID shows up as 68b482365d9086068edfa3e35d8dd41d > Corresponding file with contents: var1|s:8:"My var 1";var2|s:8:"My > var 2"; [..] > But it's clear to me that each time session_start() is called, it > doesn't open the existing session rather it creates a new one. If you just removed all things from the url, even the session id then it's not strange that php created a new session. Sessions works this way. If session_start() can't find a session id then start a new session, otherwise it reopens the old one, and creates the variables that's been stored previuosly. > When I click the 'try this link' instead when starting over. It > still creates a new session ID on the server. It's really strange, and does the same for me on you server for the first page loading. When I reload the page again (with the old session id, not the newly created) the variables are read properly from the session (var1, var2), and are shown on the page. Somehow it doesn't work on the first page load, but works later. Sorry I can't think of any other thing, but please let me know if something works, or changes. Arpi

« previous php.general (#68672) next »