t2v / play2-auth

Play2.x Authentication and Authorization module
Apache License 2.0
608 stars 142 forks source link

Question: Persistent remember me #151

Closed maxmos10 closed 9 years ago

maxmos10 commented 9 years ago

I'm trying to do an implementation of remember me which last for one month.

I followed the example on https://github.com/t2v/play2-auth/tree/master/sample/app/controllers/rememberme. Then I override AsyncIdContainer to store the token in a database instead.

Where to go after this?

Should I change the behavior of RememberMeTokenAccessor when checking for remember and maxAge? What's your thought?

gakuzzzz commented 9 years ago

I still not catch your problem...

Do you have what the trouble?

maxmos10 commented 9 years ago

Hi gakuzzzz,

Following the example from RememberMe, I log in using routes /rememberme/. After login is successful, I close the browser. Then, i believe that the Cookie maxAge will be set to None.

If I close the browser for the 3rd time, then user will have to login to access /rememberme/messages/main. How do I avoid that?

gakuzzzz commented 9 years ago

maxAge == None means that the cookie life is until the browser closing. If you want to keep the session until browser reopen, you should write maxAge explicitly.