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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -