Re: Cookie Trouble: getting the information back out...

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

 



On Tue, Mar 25, 2008 at 10:22 PM, Mark Weaver <mdw1982@xxxxxxxxxxx> wrote:
>
>  Geez! now my $_SESSION isn't persisting to the next page when the screen
>  refreshes. The only thing preventing me from gouging out my eyes right
>  now is that I know I'll get this stuff. It's just a matter of time...

    Sessions are only good on the same server as which they were set.
This is because the server writes the data to a file on its side, then
sends just a session ID cookie to the browser.  This session ID holds
no information except the key to the session file on the server with
which it's associated.

    However, if you're still on the same server, make sure that you've
used session_start() at the top of every page to which you want the
session to carry over.

    EXAMPLE:

Page1    session_start() is used and the UID of the visitor is set.
Page 2   session_start() is used, but no data is read/written.
Page 3   session_start() is NOT used, no $_SESSION data available.
Page 4   session_start() is used, and is re-initialized despite missing Page 3.

-- 
</Daniel P. Brown>
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283

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