开发者

Rails Session id

I have given the following command in my environment.rb

ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_key] = 'sessionname'

I want my application to expire to some dynamic value which i get from user. Once the session time which user gives me lapses, i want to remove all the cookies. I could expire all cookies other than the one above i.e sessionname

This holds the session id and this is the m开发者_如何学JAVAain cookie i want to expire. Could some one suggest a solution?


it's not good idea to expire session key as it will disrupt users from working with your application

i'd suggest you to have a separate permanent_session_id in cookies which you generate manually upon login and store with expiration time. then use that cookie to log users in if session does not exist.

such approach will allow users to stay logged in while using application and be logged out automatically if permanent_cookie_id is expired after restarting session.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜