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

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