On 14 October 2003 20:11, Chris Hubbard contributed these pearls of wisdom:

> All,
> I have done a number of searches.
> I have read the online documentation and user supplied
> comments. 
> 
> I recently ran into problem using:
> 
> -some code here to create session and set variables-
> header('Location: index.php');
> 
> where the sessions would sometimes get "lost", they wouldn't
> make it to the index.php page.

This coding will lose the session in any browser which is not accepting cookies.  To 
properly allow for this, you should manually insert the SID constant in your redirect 
URL.  Also, the HTTP protocol specifies that the value of the "Location:" header must 
be an absolute URL, so your header call should be:

    header ('Location: http://your.site.name.here/index.php?'.SID);

If cookies are being accepted in the current session, SID will evaluate to the empty 
string; otherwise, it will insert the necessary name=value pair.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

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

Reply via email to