Bluehost.com Web Hosting $6.95

SESSION Query

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-27-2003
Aniruddha
 
Posts: n/a
Default SESSION Query

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
Reply With Quote
  #2 (permalink)  
Old 12-27-2003
Andy Higgins
 
Posts: n/a
Default Re: SESSION Query

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:57 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0