MetaMegaProtoUser has hooks -- onLogIn, onLogOut, and autologinFunc -- that you can use. autologinFunc is called when loggedIn_? is called and no user is logged in, to give you a chance to log one in. So you can create a cookie in onLogIn, delete it in onLogOut, and read it in autologinFunc. ------------------------------------- Jeppe Nejsum Madsen<je...@ingolfs.dk> wrote:
harryh <har...@gmail.com> writes: > I want users to stay logged into my site for extended periods of time > (through server restarts, and browser restarts). By default Lift > stores a User in a SessionVar so this doesn't get me there. I've > configured jetty so the session cookie doesn't time out for 30 days, > and I have a database table with a session id -> user id mapping, Instead of using the http session id, you can maintain you own login-session id and store this in a cookie. I.e. 1) On login, create cookie with id, add mapping id->user to table 2) On logout, clear the cookie, remove mapping from table 3) If you see a request without an http session, but with valid cookie, lookup the user id in table and autologin the user 4) Periodically, clean table for entries more than 30 days old /Jeppe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---