ruby on rails - How to delete cookie when window closed? -


so, have current_user method, takes id cookie's auth_token, , want cookie deleted when window site has been closed.

 cookies[:auth_token] = @user.auth_token 

what have add?

actually, if set cookie without giving expiration date, retained until browser closed. (which can mean program itself, not window or tab.)

an expiration in past delete cookie immediately.

from thread: http://www.ruby-forum.com/topic/94682

@joe half face, if helps you, please mark useful.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -