1
votes

I'm using webapp2 authentication based on the following article: http://blog.abahgat.com/2013/01/07/user-authentication-with-webapp2-on-google-app-engine/

Currently once a user has logged in, he will basically stay logged in for three weeks until he logs out. What I'd like to do is that this only happens when the user has checked the "Remember Me" checkbox. If this box is not checked, it should expire as soon as the session is finished.

Currently when a user logs in, following code is used to login and set a token:

self.auth.get_user_by_password(username, password, remember=True,
    save_session=True)

What would be the recommended way to do this? I found some documentation in the following link, but not sure how to implement this. https://webapp-improved.appspot.com/api/webapp2_extras/auth.html

1

1 Answers

0
votes

I didn't figure out how to set the actual max_age, however by simply setting remember=False, the user is logged_out as soon as the session ends. Therewith login is:

self.auth.get_user_by_password(username, password, remember=False,
save_session=True)