• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where is the best place to read a cookie and set session variables???

#1
[eluser]bevans[/eluser]
I am doing a "Remember Me" option to let people stay logged in... I have a small problem and need some direction, please.

Currently, we are setting some variables in the session when a person logs in so their login information will persist across all pages.
But with the current settings, once the browser is closed the session is destroyed and the person must log in again when they come back to the site.

With the Remember Me option I set a cookie which is checked when they return to the site, then sets the session variables to show the person as logged in so they can persist across all pages. When the person hits the site they get a welcome back message, but the rest of the page is not showing their individual options, and must be refreshed. Once the page is refreshed they get all individual options and their information will persist across all pages.
I am guessing that the session information I am setting is getting set too late. Am I correct?

My question is where can I set the remember me cookie, read it, then set the session information so that the instant the person hits the site they are logged in with all user options and do not have to refresh the page?
I tried in the Loader.php library, but that is too soon and will not allow me to query the db for the users status to see if they are active or not. I tried a hook, but that has not worked either.

Let me know if I need to clarify what I am asking.

Thanks,
B


Messages In This Thread
Where is the best place to read a cookie and set session variables??? - by El Forum - 06-11-2008, 04:34 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.