Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Move login data into a separate session cookie #168

Closed
jace opened this issue Feb 19, 2016 · 0 comments
Closed

Move login data into a separate session cookie #168

jace opened this issue Feb 19, 2016 · 0 comments

Comments

@jace
Copy link
Member

jace commented Feb 19, 2016

To facilitate #166, Lastuser in production now has the following in its settings.py:

#: Session cookie domain
SESSION_COOKIE_DOMAIN = '.hasgeek.com'

This has the effect of setting the session cookie on *.hasgeek.com, thereby also making it available on the parent domain and all subdomains. As the cookie is now shared across apps, we need to be careful about a few additional things:

  1. The SECRET_KEY setting in all subdomain apps must match.
  2. Session variables like lastuser_userid and lastuser_sessionid must be used in exactly the same way in all apps.
  3. All app-specific session variables, including in the Lastuser app, must have a unique prefix to prevent conflicts.

To make these easier to manage, perhaps Lastuser and Flask-Lastuser should both switch to using a different cookie, perhaps named lastuser, using the same encrypted session mechanism as Flask's session cookie. This reduces the scope for conflict. Lastuser and Flask-Lastuser can look for special config for these in the LASTUSER_SECRET_KEY and LASTUSER_COOKIE_DOMAIN config variables, falling back to the default values.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant