How to make "remember me" work if session expires when browser is closed?
Asked Answered
D

1

10

I set sessions to expire when browser closes in main config.yml:

framework:
    session:
        default_locale: %locale%
        lifetime:       0
        auto_start:     true

Then I set "remember me" for login page as described in documentation and I'm getting logged out (when I restart browser) even if I check "remember me".

How to set a Symfony2 application to expire cookies when user closes browser, but persist them if one chooses to (by checking "remember me") upon login?

I'm using Symfony2-beta5 RC1 RC3.

Darendaresay answered 24/6, 2011 at 16:42 Comment(2)
That's normal for session variables. They're only meant to last until the browser is closed. What you need to use is cookies.Wear
I know that I need to use cookies. This question is Symfony2 specific and I would like to know how to do it Symfony way without actually hacking it.Spermary
F
1

I'm not sure when Beta 5 came out, but this post http://fossplanet.com/f6/%5Bsymfony-devs%5D-remember-me-authentication-67998/ leans towards it either not working, or not working right. Have you tried asking in the beta group?

Figurate answered 25/6, 2011 at 23:56 Comment(1)
No, not yet. I'll try to submit it as a bug on github and see what happens.Spermary

© 2022 - 2024 — McMap. All rights reserved.