This is a discussion on SESSION Query within the PHP General forums, part of the PHP Programming Forums category; Hi PhpTeam, Iam runing PHP 4.3.0 on Apache server. Iam expiriencing following problem when managing session: 1) I ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi PhpTeam,
Iam runing PHP 4.3.0 on Apache server. Iam expiriencing following problem when managing session: 1) I start session and register session variable by setting $_SESSION: session_start(); $_SESSION["session_referer"] = "abc.com"; 2) The above step does not register the variable "session_referer". I have following code in another page altogether: session_start(); if(isset($_SESSION["session_referer"])) { go to abc.com; } else { // CONTROL ALWAYS GETS HERE go to xyz.com; } 3) However if I redirect immediately after (1) the variable is registered properly!!? and the first "if" condition in (2) gets satisfied. 4) I use session_register then there is no problem at all. Only thing is I get a Notice that this is no more an advised method. What is the reason behind this behaviour? With regards, Aniruddha Deshpande !-- Virus-Free Mail Using PostMaster AvAc & QuickHeal Engine --! ------------------------------------------------- QuantumLink Communications Pvt Ltd, Mumbai, India ------------------------------------------------- QuantumLink Communications Pvt Ltd, Mumbai, India |
|
|||
|
Hi Aniruddha,
Try using session_start(); $HTTP_SESSION_VARS['session_referer'] = "abc.com"; and if (session_is_registered('session_referer')) go to abc.com; Regards, Andy "Aniruddha" <aniruddha@qlcomm.com> wrote in message news:6809670.1072525988504.JavaMail.sameer@sales9. .. > Hi PhpTeam, > > Iam runing PHP 4.3.0 on Apache server. > > Iam expiriencing following problem when managing session: > > 1) I start session and register session variable by setting $_SESSION: > > session_start(); > $_SESSION["session_referer"] = "abc.com"; > > 2) The above step does not register the variable "session_referer". > I have following code in another page altogether: > > session_start(); > > if(isset($_SESSION["session_referer"])) { > go to abc.com; > } > else { > // CONTROL ALWAYS GETS HERE > go to xyz.com; > } > > 3) However if I redirect immediately after (1) the variable is > registered properly!!? and the first "if" condition in (2) gets > satisfied. > > 4) I use session_register then there is no problem at all. Only thing is > I get a Notice that this is no more an advised > method. > > > What is the reason behind this behaviour? > > With regards, > Aniruddha Deshpande > > > > !-- Virus-Free Mail Using PostMaster AvAc & QuickHeal Engine --! > > > > ------------------------------------------------- > QuantumLink Communications Pvt Ltd, Mumbai, India > > > > ------------------------------------------------- > QuantumLink Communications Pvt Ltd, Mumbai, India |