php session
just a quick one,
If i start a session using php files running on my server, then move the user to my secure server does the session end or carry on through? |
I believe as long as you carry over the session number, ti should stay as the same session.
But it's been a while since i've done php. Man I should practice. |
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. |
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
|
All times are GMT -8. The time now is 09:04 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project