views:

1210

answers:

3

Ok I have several modules in my application in symfony. I have only one module that is secure: on. I also have a layout.php that on top includes a tabbed menu to display links for each module in my application. This menu also has a part where the user is displayed link to 'sign in' if user is not logged in and 'log out' if user is logged in.

When I attempt to visit the module that is secure: on I am forwarded to the sign in page. I can log in fine and the cookie is created. If I go to any other module the menu displays the 'log out' link.

Lets say I close the browser (cookie is set to expire in 15 days) and open up browser again and i go to the homepage module. I should be logged in but the menu displays 'sign in' instead (thinking no user is logged in). I try to visit the secure: on module and then when page reloads the menu displays the 'log out' link because it now reads the cookie.

What I found out is that if a cookie is set and I close browser and reopen it at the homepage there are two cookies, one 'sfRemember', and second 'symfony'. After I visit the secure module and the cookie is read, the cookie for 'symony' is totally different from what gets displayed on the homepage - this means its not reading the same cookie and thats why the 'log out' link doesnt appear until I visit the secure module. If after I open that secure module I go back to home page the application reads the cookie just fine and 'log out is displayed'.

I really have no clue how to approach this. Any help is greatly appreciated!

A: 

I've come accross this before.

My code is at work, but the explanation given in this ticket seems familiar.

http://trac.symfony-project.org/ticket/6607

benlumley
A: 

I tried the solution ont that ticket but I get this:

Fatal error: Class 'sfGuardRememberMeFilter' not found

Im using symfony 1.2 and the latest version of sfGuardPlugin. Whas that class removed? Also in my application settings.yml I enable the following modules in case this proves useful in solving this problem

Activated modules from plugins or from the symfony core

enabled_modules: [default, sfGuardAuth]

Thanks for your help!

A: 

Optionally enable the "Remember Me" filter in filters.yml

security: class: sfGuardBasicSecurityFilter

tayhimself
Did you try this before recommending it? - I think you will find that it does not work (SF 1.4)
Stick it to THE MAN