Topic: Cookie Expiration Trouble
I have been looking all over the web and reading documentation, and I can't seem to find this very simple answer. How do I set the expiration of the non-perminant cookie? The permanent cookie works well (20 year expiration), but the not permanent cookie also has a 20 year expiration! What gives? and how are you supposed to set the expiration when there is no hash of arguments to pass :expiration into? In a perfect world the non-permanent cookie would expire upon browser closing, but how to set that?
def sign_in(user, permanent) if permanent cookies.permanent.signed[:remember_token]=[user.id, user.salt] else cookies.signed[:remember_token]=[user.id, user.salt] end self.current_user = user end