Re: Fw: Session ID changes

From: Date: Tue, 07 Jan 2003 12:53:06 +0000
Subject: Re: Fw: Session ID changes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-130569@lists.php.net to get a copy of this message
Scott Fletcher wrote:
"[-^-!-%-" <monfort@engineering.sdsu.edu> wrote in message news:<Pine.GSO.4.31.0301060928360.10129-100000@kahuna.engineering.sdsu.edu>. ..
Hello all, I need some clarification. To my understanding, each visit to php site creates a UNIQUE Session ID (SID). Only when you call session_start() - this function checks for $_REQUEST[session_name()], if
there is one, it is used, else it creates one.
And, that ID stays constants until the browser is shutdown, or the session is specifically destroyed. Is this correct? If not, then please advise. Basicly yes, session cookie lifetime is controled by session_lifetime configuration directive,
its default 0 means cookie is destroyed after the browser closes.
I'm trying to develop a cookie-less, persistent, shopping cart, which saves the cart details, in a database. I need to associate each order (cart item) to the current session id. However, the session ID number, seems to change, everytime the page is reloaded. Is this how it works? Am i missing something? Session ID is stored as a cookie, or you have to pass SID constant in each
link of your page that points to your site and also as a hidden field in forms.
Please advise. Thanks. -john


« previous php.general (#130569) next »