On 04 February 2004 12:59, marc serra contributed these pearls of wisdom:

> Hi,
> 
> 
> 
> I'm working on a multi-langage website and i got problem with
> a fonction
> which destroy my session :-(
> 
> 
> 
> I got a file which change my langage like this :
> 
> 
> 
> /********************************************/
> 
> session_start();
> 
> 
> 
> if ($_POST['langue']=="us")
> 
>   $_SESSION['language']="us";
> 
> else if ($_POST['langue']=="fr")
> 
>   $_SESSION['language']="fr";
> 
> 
> 
> header("Location:
> http://".$_SERVER['HTTP_HOST'].$_POST['page_name']); 
> 
> /*********************************************/

If you rely on URL rewriting to transmit your session ID, this won't work for header 
redirects, so you need to manually include the SID value.  In any case, this is good 
defensive programming (in case that configuration parameter ever gets changed!).  So 
your redirect should look like:

header("Location: http://".$_SERVER['HTTP_HOST'].$_POST['page_name'].'?'.SID);

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