Re: session problem using headers

From: Date: Mon, 16 Jul 2001 09:54:05 +0000
Subject: Re: session problem using headers
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58027@lists.php.net to get a copy of this message
Thanks for your email. I did the changes you suggested, and the page is now going to" input.php?=" ie no record of the SID. I added the following lines to the code. echo "SID: $SID"; and echo "SID: $PHPSESSID"; and $SID was not displayed i.e just SID: was displayed. I guess this is the problem. For some reason, SID is not assigned a value. However, PHP is creating a file in /tmp on the server called sess_09591b3e465294959ecde0ee41f6c188 and as I said in the last e-mail, sessions with cookies is working fine. Thanks again for any ideas. I am using php 4.0.5 running on Sun Solaris David "scott [gts]" wrote: > you're passing the PHPSESSID incorrectly, it seems > > you must do something like this: > <A HREF="nextpage.php?<?=SID?>"> > or > header("Location: nextpage.php?$SID"); > > what you're doing now will go to page "input.php?=SID" > instead of "input.php?938sa9fa98f7daf987a9s" (or similar) > > > -----Original Message----- > > From: David Allen [mailto:david.allen@eur.crowncork.com] > > Sent: Friday, July 13, 2001 6:45 AM > > To: php-general@lists.php.net > > Subject: [PHP] session problem using headers > > > > > > Hi, > > > > I am having problems with sessions. With cookies turned on it works > > fine. Turn off cookies it fails. > > > > I have tried both > > > > header("Location: input.php?=SID"); > > header("Location: input.php?PHPSESSID=".PHPSESSID); > > > > to pass the session id to the programme input.php but neither works. > > > > The first lines of input.php are > > > > <? > > session_register("userid"); > > ?> > > > > userid is the variable I wish to pass. However, I have no other code > > related to sessions in this script. Do I need in some way "tell" the > > script to use this session id? > > > > As a have said before, it works fine if cookies are turned on. > > > > Thanks in advance for any help. > > > > David > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#58027) next »