I have set a session session to expire after an hour by doing:
session[:expire] = { :expires => 1.hour.from_now }
What I would like to do is have it so that session gets reset back an
hour whenever a new page is loaded. If, however, the session variable
has expired and the user tries to load a page I want my app to kick them
back to a loggin page. I have tried to achieve this by saying:
if !(session[:expire].blank? < 0.hour.from_now)
session[:expire] = { :expires => 0.25.hour.from_now }
end
However, it doesn't like the session[:expire]. It gives me:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.
even though I am saying if session is blank. Is there another way to do
this. Thanks,