# Session Reset when clicking back button of the browser

**URL:** <https://www.ruby-forum.com/t/session-reset-when-clicking-back-button-of-the-browser/170571>\
**Category:** Rails\
**Created:** [June 19, 2009, 5:47am UTC](https://www.ruby-forum.com/t/session-reset-when-clicking-back-button-of-the-browser/170571 "2009-06-19T05:47:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [June 19, 2009, 5:47am UTC](https://www.ruby-forum.com/t/session-reset-when-clicking-back-button-of-the-browser/170571/1 "2009-06-19T05:47:59Z")

</div>

hi friends…  
here is my query…  
kindly give ur views pls…  
after logging into the application,i redirect to company list page.now  
when user clicks the browser back button it should show the login  
page.that is i want to destroy the session.so in my login controller i  
have written code below.  
def log\_in  
if request.get?  
reset\_session  
end  
end

in my routes.rb  
map.root :controller =\> “login”,:action =\> “log\_in”  
but when i click browser back button it shows login page but it doesnot  
go to the log\_in action.  
Any helps …  
Thanks a bunch

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [June 19, 2009, 5:51am UTC](https://www.ruby-forum.com/t/session-reset-when-clicking-back-button-of-the-browser/170571/2 "2009-06-19T05:51:34Z")

</div>

I think that that will be a function of the browser. Some browsers  
reload  
the page on back button, so just display content from the cache. Either  
way, unless you can specify to not cache the page, and the browser  
honours  
it, not much you can do to stop it happening.

Simon

On Fri, 19 Jun 2009 11:47:59 +0800, Newb N.
