Welcome Guest, Not a member yet? Register   Sign In
Auth session destroyed when redirecting
#4

[eluser]WanWizard[/eluser]
Using the database is always a better option then using cookies. It's more secure, and you don't have to deal with the size limit of the cookie.

Examine the flow in your application, and the way cookies work. Cookies are sent to the client in the HTTP header of your page. This offcourse requires a page to be sent to the client.

If in your code you set session variables, and after that, in the same request, do a redirect, the cookie will never reach the client. With database sessions you don't have that problem, every modification of session variables is written directly to the database. Providing the client already has a session cookie, the new request can read the variables back fom the database.


Messages In This Thread
Auth session destroyed when redirecting - by El Forum - 07-20-2010, 03:30 AM
Auth session destroyed when redirecting - by El Forum - 07-20-2010, 04:26 AM
Auth session destroyed when redirecting - by El Forum - 07-20-2010, 04:36 AM
Auth session destroyed when redirecting - by El Forum - 07-20-2010, 04:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB