Opened 13 years ago

Last modified 10 years ago

#354 closed defect

Option to stay logged in — at Version 4

Reported by: Jef van Schendel Owned by:
Priority: minor Milestone: 0.5.0
Component: programming Keywords:
Cc: Parent Tickets:

Description (last modified by Elrond)

Users don't stay logged in after leaving a MediaGoblin site. There
is no option to stay logged in (via cookies, or whatever the best
way to do this is).

Change History (4)

comment:1 by Will Kahn-Greene, 13 years ago

The original url for this bug was http://bugs.foocorp.net/issues/707 .

comment:2 by Jakob Kramer, 12 years ago

Component: programming
Owner: set to Jakob Kramer
Status: acceptedin_progress

Started working on this.

comment:3 by Jakob Kramer, 12 years ago

Owner: Jakob Kramer removed
Status: in_progressreview

This is my solution: branch 354-save-login. Maybe it would be better if you could set the expiry time in the site configuration.

Last edited 12 years ago by Jakob Kramer (previous) (diff)

comment:4 by Elrond, 12 years ago

Description: modified (diff)
Status: reviewaccepted

Good idea.

BUT: It wont work fully, I think.

request.session is a new, fresh object for each request, even of the same user/session. Because it is created from the contents of the sent cookie. So the extra .max_age will only be set on the session straight on the login action. So yes, it will affect the cookie that is set at login.

But if the cookie is modified later on by modifying the session, then there wont be any max_age and the cookie will be sent as a session cookie. I don't know, what browsers do, when cookies change from having an expire time to not having one.
If you want to test: Do anything that creates a message at the top. For example post an empty comment.

So the max_age should possibly be put in the session itself, so that it can be used later on again?

Note: See TracTickets for help on using tickets.