on 03/06/03 9:43 PM, Ford, Mike               [LSS] ([EMAIL PROTECTED])
wrote:

>> -----Original Message-----
>> From: Justin French [mailto:[EMAIL PROTECTED]
>> Sent: 03 June 2003 06:34
>> To: Monty; [EMAIL PROTECTED]
>> 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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to