Hi There,
Im going through the ruby on rails tutorial 'Railsspace' at the moment.
There is a :remember_me function that allows a cookie to be set at login to remember the user. See below:
if @user.remember_me == "1" cookies[:remember_me] = { :value => "cookie name", :expires => 2.minutes.from_now } user.authorization_token = Digest::SHA1.hexdigest( "#{user.username}: #{user.password}")
user.save! cookies[:authorization_token] = { :value => user.authorization_token, :expires => 2.minutes.from_now } else cookies.delete(:remember_me) cookies.delete(:authorization_token)
When i look in safari's preferences, I can see that the cookie is set. Agfter the 2 mins, I refresh the web page, and....
- Safari removes the cookies, but the user still looks logged in.
Is there a way to amend this to ensure that say, after 15 mins, the user is automatically logged out.
Can anyone help?
Many Thanks