Re: [PHP] header lost session variables.
Hi guys. Anyone here know why in some cases when i use (header(Location: ???); the system lost the session variables? Any tips will be apreciated. Thanks in advantge. Please tell me the cases you mean..! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header lost session variables.
I´m in the follow location: https://www2.../?modulo=seguroacao=identifica And in my script i use header(Location: ./?modulo=seguroacao=novo_cadastro) When it run, my system lost all session variables. BBC [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] Hi guys. Anyone here know why in some cases when i use (header(Location: ???); the system lost the session variables? Any tips will be apreciated. Thanks in advantge. Please tell me the cases you mean..! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header lost session variables.
On 8/15/06, João Cândido de Souza Neto [EMAIL PROTECTED] wrote: I´m in the follow location: https://www2.../?modulo=seguroacao=identifica And in my script i use header(Location: ./?modulo=seguroacao=novo_cadastro) i normally do header(Location: ?modulo=seguroacao=novo_cadastro); thats with out the ./ but i'm not sure if its has any effect. try it out anyway. i could not think of any reason why your session variables will disappear, unless you don't do session start() :) hehehe...(in which of course you do) if possible could you paste some of your codes so others can take a look at it. When it run, my system lost all session variables. BBC [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] Hi guys. Anyone here know why in some cases when i use (header(Location: ???); the system lost the session variables? Any tips will be apreciated. Thanks in advantge. Please tell me the cases you mean..! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- GMail Rocks!!!
Re: [PHP] header lost session variables.
On Mon, August 14, 2006 8:04 am, João Cândido de Souza Neto wrote: Anyone here know why in some cases when i use (header(Location: ???); the system lost the session variables? Yes. The browser gets headers such as this: Location: http://example.com Cookie: Example Value *SOME* browsers, as soon as they see that Location: line, will IMMEDIATELY go to the other URL, ignoring the Cookie line. Don't do that. If the Location: is your own PHP code, just include() it and do exit; and call it fixed. You can also try to throw a session_write_close (?) before the header(Location: ) line -- Others have posted some success with that, but I suspect it won't fix things for EVERY browser out there. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header lost session variables.
On Mon, August 14, 2006 6:56 pm, J R wrote: On 8/15/06, João Cândido de Souza Neto [EMAIL PROTECTED] wrote: I´m in the follow location: https://www2.../?modulo=seguroacao=identifica And in my script i use header(Location: ./?modulo=seguroacao=novo_cadastro) i normally do header(Location: ?modulo=seguroacao=novo_cadastro); thats with out the ./ but i'm not sure if its has any effect. try it out anyway. i could not think of any reason why your session variables will disappear, unless you don't do session start() :) hehehe...(in which of course you do) HTTP RFC Specs require that Location be a complete URL starting with http://; so you're pretty much both making a fundamental error here... :-) :-) :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] header and session?
With register_globals on, $a and $b need to be registered using session_register(). Don't assign them to $_SESSION, PHP does that for you with register_globals on. 1.php - session_start(); $a = 'some_value'; $b = 'nuther_value'; session_register('a','b'); header(location: 2.php); 2.php - session_start(); echo a is $a; echo b is $b; -Original Message- From: bob [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 8:52 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] header and session? On Mon, 25 Mar 2002 08:54:27 -0700, [EMAIL PROTECTED] (Johny? ?rk) wrote: Do you have register_globals turned on or off in php.ini? What values are $a and $b being set to? Kirk -Original Message- From: bob [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 24, 2002 4:21 PM To: [EMAIL PROTECTED] Subject: [PHP] header and session? 1.php?2.php session_start(); session_start(); .. .. $_SESSION['a'] =$a; echo $_SESSION['a']; $_SESSION['b'] =$b; echo $_SESSION['b']; header(location: 2.php); after jump to 2.php ,there is an warning: undefined index a ,b if i change 1.php to session_start(); .. $_SESSION['a'] =$a; $_SESSION['b'] =$b; a href='2.php' go on /a it works well! register_globals is on.$a,$b is set to $_SESSION array,which is global in any scope. the problem is i submit a login form to 1.php,which register some session variable.then,in 2.php,i fail to print them out. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] header and session?
Do you have register_globals turned on or off in php.ini? What values are $a and $b being set to? Kirk -Original Message- From: bob [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 24, 2002 4:21 PM To: [EMAIL PROTECTED] Subject: [PHP] header and session? 1.php?2.php session_start(); session_start(); .. .. $_SESSION['a'] =$a; echo $_SESSION['a']; $_SESSION['b'] =$b; echo $_SESSION['b']; header(location: 2.php); after jump to 2.php ,there is an warning: undefined index a ,b if i change 1.phpto session_start(); .. $_SESSION['a'] =$a; $_SESSION['b'] =$b; a href='2.php' go on /a it works well! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header and session?
On Mon, 25 Mar 2002 08:54:27 -0700, [EMAIL PROTECTED] (Johny? ?rk) wrote: Do you have register_globals turned on or off in php.ini? What values are $a and $b being set to? Kirk -Original Message- From: bob [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 24, 2002 4:21 PM To: [EMAIL PROTECTED] Subject: [PHP] header and session? 1.php?2.php session_start(); session_start(); .. .. $_SESSION['a'] =$a; echo $_SESSION['a']; $_SESSION['b'] =$b; echo $_SESSION['b']; header(location: 2.php); after jump to 2.php ,there is an warning: undefined index a ,b if i change 1.php to session_start(); .. $_SESSION['a'] =$a; $_SESSION['b'] =$b; a href='2.php' go on /a it works well! register_globals is on.$a,$b is set to $_SESSION array,which is global in any scope. the problem is i submit a login form to 1.php,which register some session variable.then,in 2.php,i fail to print them out. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php