Re: Php Sessions
| From: | Austin Marshall | Date: | Sun, 05 May 2002 17:00:04 +0000 |
| Subject: | Re: Php Sessions | ||
| References: | 1 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-96161@lists.php.net to get a copy of this message | ||
Daniel SvanbäCk wrote:
Hi I have a problem. I can't send the session_id to the next page. It worked before (when I had an old version of php, now I have 4.2.0). It can send the session_id() if it's a link, but not a header(). If it is a header I have to do this: define('MYSID', session_name().'='.session_id()); header('Location: ../index.php?'.zOLSID); Do I have to add this to every header()? Or is there a easyier way. I have global variables = on. //DanielStraight from the manual at http://www.php.net/manual/en/ref.session.php PHP is capable of doing this transparently when compiled with --enable-trans-sid. If you enable this option, relative URIs will be changed to contain the session id automatically. Alternatively, you can use the constant SID which is defined, if the client did not send the appropriate cookie. SID is either of the form session_name=session_id or is an empty string. You probably didn't have --enable-trans-sid when you configured/compiled PHP