This is a discussion on Session dies after HEader redirect within the PHP Language forums, part of the PHP Programming Forums category; I appreciate the links on the session variables. I had actually hit that and finished the login and supporting pages. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I appreciate the links on the session variables. I had actually hit that
and finished the login and supporting pages. Thanks for everything. I noticed that PHP.NET said to do a HEADER Location: for a client re-direct. When I do that thoughm it seems either the session is destroyed, or the ID is lost. If I set session variables, then do a Header redirect, the variables are empty at the new page. While I *could* just say "You are now logged in, click here to continue", tht sounds kind of silly to me. Any other way? bt3of4 |
|
|||
|
BT3 wrote:
> I appreciate the links on the session variables. I had actually hit that > and finished the login and supporting pages. Thanks for everything. > > I noticed that PHP.NET said to do a HEADER Location: for a client re-direct. > When I do that thoughm it seems either the session is destroyed, or the ID > is lost. If I set session variables, then do a Header redirect, the > variables are empty at the new page. While I *could* just say "You are now > logged in, click here to continue", tht sounds kind of silly to me. Any > other way? This is known behaviour for non-cookie based sessions. Workaround: append SID *manually*--but only for redirection. -- <?php echo 'Just another PHP saint'; ?> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/ |
|
|||
|
new problem.
I'm doing a session_start(); at the beginning of the script. Towards the end of the script I'm setting up the redirection, but SID doesn't return anything. Bt3of4 "BT3" <honeypot@epmctc.com> wrote in message news:JMdfe.876$Db6.565@okepread05... > I appreciate the links on the session variables. I had actually hit that > and finished the login and supporting pages. Thanks for everything. > > I noticed that PHP.NET said to do a HEADER Location: for a client re-direct. > When I do that thoughm it seems either the session is destroyed, or the ID > is lost. If I set session variables, then do a Header redirect, the > variables are empty at the new page. While I *could* just say "You are now > logged in, click here to continue", tht sounds kind of silly to me. Any > other way? > > bt3of4 > > |
|
|||
|
This needs to have a few configuration options changed...
Note that getting the sessionid MUST be called before session_start() otherwise you will replace the current sessionid. Therefore you should retrieve it as follows: session_start(); //your code session_write_close(); $sessid = session_id(); This way the session is closed and then you can retrieve the id :) Mike |
|
|||
|
BT3 wrote:
> new problem. > I'm doing a session_start(); at the beginning of the script. > Towards the end of the script I'm setting up the redirection, but SID > doesn't return anything. That means, session id is not found in the query string. Constant SID and session_id() function are different. -- <?php echo 'Just another PHP saint'; ?> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/ |