diff options
author | Jakob Kramer <jakob.kramer@gmx.de> | 2013-05-10 00:40:13 +0200 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-07-11 14:56:40 -0700 |
commit | 527b7e3b57906a86dae914daae0399b04b3b5388 (patch) | |
tree | 7b6b5786d0a944e7a1a640bfd1c6192578991843 /mediagoblin/auth | |
parent | a4dcb1f46a89f33d4946219b02bce6325fb68e50 (diff) | |
download | mediagoblin-527b7e3b57906a86dae914daae0399b04b3b5388.tar.lz mediagoblin-527b7e3b57906a86dae914daae0399b04b3b5388.tar.xz mediagoblin-527b7e3b57906a86dae914daae0399b04b3b5388.zip |
add login option: stay_logged_in
As proposed in issue #354; it adds an attribute max_age
to mediagoblin.tools.session.Session that is passed to
response.set_cookie; max_age is set to 30 days if the
checkbox is selected
Diffstat (limited to 'mediagoblin/auth')
-rw-r--r-- | mediagoblin/auth/views.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 1cff8dcc..d276a074 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -88,6 +88,8 @@ def login(request): if user: # set up login in session + if login_form.stay_logged_in.data: + request.session.max_age = 30 * 24 * 60 * 60 request.session['user_id'] = unicode(user.id) request.session.save() |