Re: Cookies and Sessions: What's the Best Recipe?

From: Date: Tue, 03 Jun 2003 10:15:20 +0000
Subject: Re: Cookies and Sessions: What's the Best Recipe?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-149933@lists.php.net to get a copy of this message
on 03/06/03 9:43 PM, Ford, Mike [LSS] (M.Ford@lmu.ac.uk) wrote: >> -----Original Message----- >> From: Justin French [mailto:justin@indent.com.au] >> Sent: 03 June 2003 06:34 >> To: Monty; php-general@lists.php.net >> Subject: Re: [PHP] Cookies and Sessions: What's the Best Recipe? >> >> >> Hmmmm, >> >> Theory only here: >> >> If there is a GET value of PHPSESSID (or whatever your >> sessions are named), >> then the user is more than likely taking advantage of >> trans-sid (sid's in >> the URLs), and cookies are not available. >> >> So, we only want to append the sid to URLs in a redirect IF >> the sid is found >> in the URL already. If there is no SID in the URL, then >> perhaps we can >> assume it doesn't need to be this time???? > > Guys, that's exactly what the SID predefined constant is for -- it's defined > only when a session is active, and it has the value > <sessionname>=<sessionid> (e.g. PHPSESSID=1afd764ecb938274) if and only if > the session id was passed in the URL -- otherwise it contains the empty > string. So you can safely do: > > header("Location: {$location}?".SID); > > and get the desired result. Good point... except I had some problems with SID a while back... must do some re-testing... can't remember much about it now. Thanks mike. Justin

« previous php.general (#149933) next »