# How to disable the back functionality of the browser after we log out

**URL:** <https://www.ruby-forum.com/t/how-to-disable-the-back-functionality-of-the-browser-after-we-log-out/185448>\
**Category:** Rails\
**Created:** [March 20, 2010, 10:10am UTC](https://www.ruby-forum.com/t/how-to-disable-the-back-functionality-of-the-browser-after-we-log-out/185448 "2010-03-20T10:10:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahesh\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@mahesh\_s](https://www.ruby-forum.com/u/mahesh_s)\
**Post date:** [March 20, 2010, 10:10am UTC](https://www.ruby-forum.com/t/how-to-disable-the-back-functionality-of-the-browser-after-we-log-out/185448/1 "2010-03-20T10:10:09Z")

</div>

\*hello friends,

in my project after logged out when the user hits back button he is  
redirected to previous page but when i click or any event is occured  
then  
page is redirected to login page using before filter, but i need to  
restrict  
the user to view only login page before logged in. Since i included lot  
of  
script files this particular code in onload function is loaded after a  
few  
seconds only.

```
history.forward();

```

can anyone help me to fix this issue\*

Regards

Mahesh
