03-11-2005, 11:31 PM | #3 (permalink) |
Insane
Location: Austin, TX
|
no, if you redirect to a different server, the session will be lost. Session data is cached on the web server's hard drive, so unless you've got a shared directory set up for the session data, you can't guarantee the session will move.
One caveat to this is if you use cookies. You can tell PHP to force the user's browser to keep a cookie containing the session data. This will also be mirrored on the web server's hard drive "just in case". If you are careful, you can probably convince the browser to save the session data during the redirect and then retrieve it again on the new server. |
03-11-2005, 11:46 PM | #4 (permalink) |
Junkie
Location: Florida
|
I'd suggest storing the session data in an SQL table. Then you can pass the ID on to the other server and it can continue to use the data. There are several PHP classes available to do this with MySQL, for instance: http://www.code.dearneighbor.com/db_esession.html
|
Tags |
php, session |
|
|