Thursday, March 17, 2011

Symfony Session Timeout

Session handling is one of the most important things in web development, it helps to track user, its activity and most importantly give user a personalization feel, Symfony make it very easy to handle user Sessions by changing just one value in a yaml file you can manage user's Sessions, lets get to point :) i am using Netbeans (great IDE) for my development... open you project in Netbeans, if you dont know how to configure Symfony to work with Netbeans this might help you.

Symfony Session Timeout

Open factories.yml located in apps/[MODULE_NAME]/config/factories.yml you will see somthing like this...
all:
  user:
    class: myUser
    param:
      timeout: false
myUser is the child class of sfBasicSecurityUser which is in apps/[MODULE_NAME]/lib/myUser.class.php you can change the name of the class, timeout is the property that controls Session time out of user if this is set as false time out never occur if a numeric value is given time out will occur after that, timeout value is in milliseconds i.e. if value is 36000 timeout will occur in 10 min (60*60*10), simple and easy is not it?

2 comments:

php ecommerce on March 19, 2011 at 3:31 AM said...

Thanks for this tutorial. I save this post and will keep visiting this site to get more informative post regarding php.

Bernfried said...

My expectation of a session timeout was, that is starts always from the last activity. But it seems to me that once I have logged in, the session timeout period starts and will always end after e.g. 10 minutes. Am I right and do I need to configure something to change it to my expectation? Thanks for any help.

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems