logo
Ask your Symfony questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$4
Why would Remember Me not work with sfDoctrineGuardPlugin?

On a new site with Symfony 1.4 I've installed sfDoctrineGuardPlugin. I tried to enable the "Remember Me" function, but it does not work. I've followed the directions carefully. I'm wondering if I missed something obvious?

In app.yml I have:

all:                                                                                                        
sf_guard_plugin:
remember_key_expiration_age: 25920000 # 30 days in seconds
remember_cookie_name: myAppRememberMe


In myUser.class.php I have:

class myUser extends sfGuardSecurityUser                              
{
}



In filters.yml I have:


rendering: ~

remember_me:
class: sfGuardRememberMeFilter

security: ~

# insert your own filters here

cache: ~
execution: ~


The cookie gets set with the correct value -- see the screenshot.

So what did I miss?

I've done all this, yet I still get logged out after about 15 minutes.

This question has been answered.

attachment image asker uploaded image

Lawrence Krubner | 03/08/11 at 12:40pm Edit


The experts have suggested, on average, a prize of $5 for this question.

(5) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    03/08/11
    12:47pm
    Arturo Linares says:

    The first things I would check:
    - are to cookies enabled in the browser?
    - clear the symfony cache. ($ php symfony cc)

  • avatar
    Last edited:
    03/09/11
    11:28am
    Gergely Szilagyi says:

    Hi Lawrence!

    I had same problem a month ago, and it takes many time, but the problem solved finally.
    Sadly the cookie expire is not enougth... you need configure your php ini settings, cause the GC collect the session, before if expire at the client..
    This is for sf1.2, but i'm sure, it works under 1.4 too ....
    Anyway , the apache config will help!!!

    The following configuration solved my problem ( check the attachement its absolutle necessary!!! )

    PLUS :


    ###########
    # myUser.class.php - in your application/lib dir

    class myUser extends sfGuardSecurityUser
    {
    public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $options = array())
    {
    // disable timeout anyway, doesn't matter, what user checked
    $options['timeout'] = false;
    parent::initialize($dispatcher, $storage, $options);
    }
    .....
    }



    ###############
    # cache.yml - in your application/config dir
    default:
    enabled: off
    with_layout: false
    lifetime: 86400



    ############
    #factories.yml - in your application/config dir

    all:
    routing:
    class: sfPatternRouting
    param:
    generate_shortest_url: true
    extra_parameters_as_query_string: true

    user:
    class: myUser
    param:
    timeout: 864000
    logging: %SF_LOGGING_ENABLED%
    use_flash: true
    default_culture: %SF_DEFAULT_CULTURE%
    storage:
    class: sfSessionStorage
    param:
    session_name: symfony
    session_cookie_lifetime: 864000

    attachment image expert uploaded image

    Previous versions of this answer: 03/08/11 at 6:55pm | 03/08/11 at 6:55pm | 03/08/11 at 6:56pm

  • avatar
    Last edited:
    03/08/11
    3:45pm
    Lawrence Krubner says:

    Arturo,

    Please look at the screenshot. It shows the output I get in FireFox on a Mac, regarding the cookie that I get.

    I've clear-cache many, many times.

  • avatar
    Last edited:
    03/09/11
    11:05am
    Lawrence Krubner says:

    Thanks, but why this in cache.yml:

    default:
    enabled: off


    Is enabled supposed to be off?

  • avatar
    Last edited:
    03/09/11
    11:08am
    Lawrence Krubner says:

    Nevermind, I see that is standard here:

    http://www.symfony-project.org/reference/1_4/en/09-Cache

This question has expired.





Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.