You can tweak out the sessions to enable the system to remember the person,
or you could enable a custom mechanism in your code to store some
identifying information in a cookie, and then check that cookie when they
hit your site.

We did a little of this to remember the user name that logged in after a
session expired, but we didn't really work through all the "partial login"
sort of functionality that you see on some sites - the kind where you're
accepted for who you say you are for a bit (like viewing), but when it comes
time to do something "heavy", your authentication is verified...

Since cookies are pretty inherently insecure and easy to "snatch", we
decided against doing anything heavy there.

-joe

On 12/26/06, Vadim Macagon <[EMAIL PROTECTED]> wrote:


Hi,

I'm trying to figure out how to implement the "Remember Me" check-box on
my login page, oddly enough I haven't managed to find any code snippets
for this seemingly common functionality.

It seems to me that right now the only way to change the lifetime of
sessions is by changing
django.conf.settings.SESSION_EXPIRE_AT_BROWSER_CLOSE, however that
affects all users, which is not what I want here. Am I missing some
obvious solution to this?

I could probably write a new middleware class to replace
SessionMiddleware, with the only difference being the process_response()
method that would use a new request.SESSION_EXPIRE_AT_BROWSER_CLOSE
setting and if that wasn't set default to using
django.conf.setting.SESSION_EXPIRE_AT_BROWSER_CLOSE. That way you could
theoretically change the lifetime of an individual session per response
without affecting any other sessions. However this seems like the sort
of thing that should be handled right out of the box by the current
SessionMiddleware.


-+ enlight +-

>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to