Re: SESSION Query

From: Date: Sat, 27 Dec 2003 13:34:59 +0000
Subject: Re: SESSION Query
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173368@lists.php.net to get a copy of this message
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

« previous php.general (#173368) next »