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

Symfony 1.4 / sfDoctrineGuard stay signed in Symfony

I have a Symfony 1.4 / sfDoctrineGuard application and like to add a stay signed in function. I already found sfGuardRememberMeFilter, but how to use it? Is there a tutorial or something like that?

Answers (2)

2012-01-15

Milena Dimitrova answers:

In order to enable sfGuardRememberMeFilter you have to edit security.yml of your secure app: add the filter and respective class name just above the security filter:

remember_me:
class: sfGuardRememberMeFilter

security: ~


Here is the tutorial (click on the Readme tab):
[[LINK href="http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin"]]http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin[[/LINK]]


sn comments:

I've already done this:

<blockquote>Change the name or expiration period of the "Remember Me" cookie
By default, the "Remember Me" feature creates a cookie named sfRemember that will last 15 days. You can change this behavior in app.yml:

all:
sf_guard_plugin:
remember_key_expiration_age: 2592000 # 30 days in seconds
remember_cookie_name: myAppRememberMe</blockquote>

however no cookie is set. Don't I need to add some checkbox to the login form or something similar?


sn comments:

OK. Seems like it is working, but there is an IP restriction on the Remember Me token. Is there a way to remove the IP address restriction? In the main target country of the website it's common for ISPs to disconnect their customers after a certain idle-time, so they get new dynamic IPs every few hours.

2012-01-15

Luis Cordova answers:

yep configuration just like in sf2 :D