diff --git a/doc/getting_started/configuration.rst b/doc/getting_started/configuration.rst index 654f183ad..ee544263d 100644 --- a/doc/getting_started/configuration.rst +++ b/doc/getting_started/configuration.rst @@ -147,14 +147,9 @@ Few parameters need to be set in the *settings.py* configuration file to make Modoboa behave as expected:: SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Default value - SESSION_COOKIE_AGE = 600 # time in seconds -The first parameter is optional but you must ensure it is set to -``False`` (the default value). - -The second one tells Django that a session inactive for this time -should be considered as closed. You are free to adjust it according to -your need. +This parameter is optional but you must ensure it is set to ``False`` +(the default value). The default configuration file provided by the *modoboa-admin.py* command is properly configured. diff --git a/modoboa/auth/views.py b/modoboa/auth/views.py index c9b098044..d8464e496 100755 --- a/modoboa/auth/views.py +++ b/modoboa/auth/views.py @@ -20,9 +20,9 @@ def dologin(request): user = authenticate(username=form.cleaned_data["username"], password=form.cleaned_data["password"]) if user and user.is_active: + login(request, user) if not form.cleaned_data["rememberme"]: request.session.set_expiry(0) - login(request, user) if request.user.has_mailbox: request.session["password"] = encrypt(form.cleaned_data["password"]) diff --git a/modoboa/core/templates/settings.py b/modoboa/core/templates/settings.py index d2a5d6d87..4f926f712 100644 --- a/modoboa/core/templates/settings.py +++ b/modoboa/core/templates/settings.py @@ -179,8 +179,6 @@ AUTHENTICATION_BACKENDS = ( 'modoboa.lib.authbackends.SimpleBackend', ) -SESSION_COOKIE_AGE = 600 - # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error when DEBUG=False.