Authentication expiration time

38 views
Skip to first unread message

rtconner

unread,
Jun 17, 2007, 1:30:49 AM6/17/07
to Django users
Hello, I'm new to DJango, but have used other frameworks.

(http://www.djangoproject.com/documentation/authentication/)
I love the fairly complete docs on authentication. I had one question
which did not get answered. Is there any concept of login expiration
time implemented in the builting authentication? Perhaps log a user
out after 30 minutes of inactivity. And what about setting cookies to
remember a user for the next time they open their browser, is this
handled by the authentication?

Thanks, DJango looks nice. I'm excited about digging in.

-Rob

Chatchai Neanudorn

unread,
Jun 17, 2007, 4:11:17 AM6/17/07
to django...@googlegroups.com
Rob
 
        You can control cookie expiration by setting SESSION_COOKIE_AGE. Default value is 2 week (1209600 seconds). You can try 'remember' user login by closing browser without clicking 'Log out' button. Nex time your visite that page, you can access it without re-login.
 
        For security reason, you can set cookie to 'SESSION_EXPIRE_AT_BROWSER_CLOSE' to True.
 


 
2007/6/16, rtconner <rtco...@gmail.com>:

Hello, I'm new to DJango, but have used other frameworks.

itsnotvalid

unread,
Jun 17, 2007, 11:02:01 AM6/17/07
to Django users
That works, but it changes the behavior of all cookies set in the
site.
What if I need to have different expiration times for different
cookies, or if I have to offer the user an option on how long the
cookies' kept?

rtconner

unread,
Jun 17, 2007, 6:47:12 PM6/17/07
to Django users
What about the "log user out after 30 minutes" part of my quesiton?

On Jun 17, 2:11 am, "Chatchai Neanudorn" <meledic...@gmail.com> wrote:
> Rob
>
> You can control cookie expiration by setting SESSION_COOKIE_AGE.
> Default value is 2 week (1209600 seconds). You can try 'remember' user login
> by closing browser without clicking 'Log out' button. Nex time your visite
> that page, you can access it without re-login.
>
> For security reason, you can set cookie to '
> SESSION_EXPIRE_AT_BROWSER_CLOSE' to True.
>

> 2007/6/16, rtconner <rtcon...@gmail.com>:


>
>
>
> > Hello, I'm new to DJango, but have used other frameworks.
>

> > (http://www.djangoproject.com/documentation/authentication/)

SmileyChris

unread,
Jun 17, 2007, 11:13:34 PM6/17/07
to Django users
There's recent activity on a ticket which will address this:
http://code.djangoproject.com/ticket/2548

Reply all
Reply to author
Forward
0 new messages