• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

To check the session state when browser Back button is pressed

New Here ,
Oct 31, 2007 Oct 31, 2007

Copy link to clipboard

Copied



I am working on an application where by when user press browser's back button even after logged out, can able to see secure home page.

Can anyone help me to control this?

Thanks a lot in advance.

TOPICS
Advanced techniques

Views

624

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 31, 2007 Oct 31, 2007

Copy link to clipboard

Copied

You need to setup the pages to not cache.

<cfheader name="Expires" value="#Now()#">
<cfheader name="Pragma" value="no-cache">

Then when a user clicks the back button, the browser will be forced to re-request that page.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 31, 2007 Oct 31, 2007

Copy link to clipboard

Copied

I have used
<cfheader name="Expires" value="#Now()#">
<cfheader name="Pragma" value="no-cache">
on secure home page as the first line of code as per your suggestions.
But still problem continues...

When I click on sign out, I go to public home page. When I prese browser back button, again secure home page is displayed with all the data. Again when I refresh the page, it goes to login screen.

Please advice on this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 01, 2007 Nov 01, 2007

Copy link to clipboard

Copied

I use this variation successfully.

<cfheader name="Cache-Control" value="no-cache">
<cfheader name="Pragma" value="no-cache">
<cfheader name="Expires" value="-1">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2007 Nov 01, 2007

Copy link to clipboard

Copied

LATEST
I even tried this...and it doesn't work

Thanks for help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation