Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Back Button Issue

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
If i click the back button it is showing the previous page even after logging out from that page. Please help me to solve this issue.......
Thanks in advance..
 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most common problem is that we write what we see in front of us but the fact is that it is known/clear only to us and not to everyone.So you have to always brief it to an extent.What you wrote is what was happening before you and not what is happening within!

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The back button will always show the previous page. If the user tries to do an action on that page, your backend should not let it happen.

Only way to get an expired page is to use no caching headers and posts, but that kills your user's experience.

Eric
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When user clicks on the back button, you can make it appear to remain on the current page using a simple javascript like


The same can be accomplished by location.replace(url) in javascript.
You may also google to see if you want to disable the browser back button altogether.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

window.history.forward(1);


Don't do that, nor try to attempt disabling the back button: InterfaceDesignersRule1
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hetal Vora wrote:You may also google to see if you want to disable the browser back button altogether.


Worst. Advice. Ever.
 
kokila devi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Thank you sir, I've tried it and also it works. But this javascript is working out well only in internet explorer and not in mozilla firefox, while trying in mozilla it is going back once and then closing the session. Please help me to solve this browser issue.....

Thanks in advance.
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic