Hi there i want to display an error message if the session is closed, cause if i log in and and i press the go back at the top of the browser and then press the go forward and try to refresh the page it display an error message that it couldn't find the current user who was in the session and i want to display a page for handling that error message. like your session has expired.
A:
You have to redirect that user to directly at the login page. And just display the error message that your session has been expired. Plz login again. Or you can also ask them to resend request to server if particular user wants it.
Nirmal
2009-04-07 13:59:54
+1
A:
If I understand you correctly you are looking to do something like this in your login_required function or the like.
cookie_session = request.cookies['my_app_session']
unless cookie_session.blank? && Session.find_by_session_d(cookie_session).blank?
flash[:warning] = "Your session is expired, please login again"
redirect_to new_session_path
end
This example should be treated as such but it might give you an idea what to do.
Maran
2009-04-07 14:38:25
A:
Thanks for the great answers, my problem is solved.jst that i forgot to notify you guys that my problem is solved..apologies
Donald
2009-04-16 11:37:26