Re: [flask] 'remember me' functionality & populating the session
- 2014-10-11 @ 01:34
On Sat, Oct 11, 2014 at 6:34 AM, Wells Oliver <firstname.lastname@example.org> wrote:
> Hey all.
> How can I wire up my app to run a function every time the user is logged in
> via the cookie set with Flask's remember=True functionality?
> I have my nice login() method that calls login_user(...., remember=True) AND
> populates some session information, but when the user comes back and is
> logged in via flask's black magic remember me stuff, the session stuff isn't
You should save the remember me information in a cookie, not in the
session cookie (the session itself is stored in a cookie, but you need
to store the remember be information in other cookie). Also you'd need
to set the cookie lifetime to a longer time (1 month, etc.).