Re: Session problem in PHP4.0.3pl1

From: Date: Sat, 28 Oct 2000 07:31:23 +0000
Subject: Re: Session problem in PHP4.0.3pl1
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22423@lists.php.net to get a copy of this message
You might check out the following article: http://www.devshed.com/Server_Side/PHP/Sessions/ Here is the chuck of the article specifically touching on the problem you are trying to address. Hope it helps: Finally, before we get to PHPLIB, there's one technical issue you should be aware of - all the examples above use cookies to store the session id on the client. But what happens if the client browser is set to reject cookies? In such an eventuality, it becomes necessary to pass the session id from one page to another by embedding it in the URL. For example, ---------------------------------------------------------------------------- ----<a href="http://www.someserver.com/admin/preferences.php3?PHPSESSID=<? echo "$PHPSESSID"; ?>">Edit Your Portfolio!</a>-------------------------------------------------------------- ------------------ This helps to ensure that session variables are available on subsequent pages. Kevin Leavell Leavell Digital Design ----- Original Message ----- From: Paulson, Joseph V. "Jay" <jay.paulson@viatel.com> To: <php-general@lists.php.net> Sent: Friday, October 27, 2000 4:49 PM Subject: [PHP] Session problem in PHP4.0.3pl1 > Hello everyone! > I've got a new problem now. When I call the session_start() function it > creates a new session id for the current session when a user logs into my > site. However, on the next page the user goes to I call session_start() > again as normal, BUT for some reason it gives the user a new session id. I > don't have a clue as to why it's doing this and I've tried several things. > I've tried: > > session_id($SID); > session_start(); > > I tried this to over ride the new session id that session_start() creates > (the $SID is passed through the URL throughout the enitre site after a user > logs on). This doesn't work and it still creates a new session id. This > creates a huge problem because I'm not using cookies just the files that php > creates in the /tmp directory. > > What I'm finding is that all my user session variables are being set to one > of these files but with the session_start() always giving the user a new > session id I lose these session variables. This is very frustrating and I > was wondering if anyone had the same problem and what did you do? Any > suggestions on how to keep the same session id throughout the site so php > won't create a new one everytime session_start() is called (FYI it even > creates a new session id if you don't use session_start() but instead use > session_register() when you register your variables). > > Anyway, thanks for any help you can offer! :) > > Jay Paulson > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#22423) next »