Re: Session ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/8/2012 11:41 AM, Jim Giner wrote:
On 12/8/2012 11:04 AM, Daniel Brown wrote:
     You can pass the session ID and reactivate the session that way,
sure.  Not pretty, and it does lead to security considerations, but it
would work.

OK - I've done this in script 1:

if (isset($_REQUEST['sess']))
     $sess_id = $_REQUEST['sess'];
else
     $sess_id = '';
if ($sess_id > '')
{
     session_start($sess_id);
     $errmsg .= "started sess id is: $sess_id ";
}
else
{
     session_start();
     $errmsg .= "started new sess ";
}


Then my process creates a Session array and calls script 2
In script 2 I have:

if (isset($_GET['sess']) && $_GET['sess'] <> '')
{
     $sess_id = $_GET['sess'];
     session_start($sess_id);
     $errmsg .= "started sess $sess_id ";
}
else
{
     session_start();
     $sess_id = session_id();
     $errmsg = "started NEW sess with id of $sess_id ";
}

My $errmsg shows me the same sess id in both scripts, and it would
appear that I have managed to pass my session across the sub-domains.
But when script 2 attempts to access the contents of the Session array
created in script 1 it doesn't find it.  What am I not doing?

Forgot to mention that when I do header(...) to go to script 2 that I do append the session id to my url
Same on the return from script 2 back to script 1.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux