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

Old variable value if back button is pressed

Guest
Feb 26, 2010 Feb 26, 2010

Hi,

first of all I hope to provide a clear explanation of the problem I'm dealing with, if not I apologize.

In my fantasy football website I enable users to change only one player from their roster on a weekly basis.

No problem with that: once the new player has been selected, the change is made and the user gets sent to a page confirming that everything went right.

The new roster is shown updated if the user clicks on the "roster" link on the main menu.

A problem arises if the user pushes the browser's back button instead, since the form which enables roster changes becomes available again (and I'll somehow have to make sure that it doesn't), but most of all, if the user presses back again, the page with the original roster is shown, i.e. displaying the player just dropped instead of the newly acquired one.

I guess something must be added at the beginning of the page showing the roster, but I wonder what sort of check it should perform.

Any suggestions ? Do I have to provide code ?

Thank you

Giovanni

TOPICS
Getting started
943
Translate
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

correct answers 1 Correct answer

LEGEND , Mar 02, 2010 Mar 02, 2010

Pages are cached by default.  The following three commands will make them not cache.

<CFHEADER NAME="Cache-Control" VALUE="no-cache, no-store, must-revalidate">
<CFHEADER NAME="Pragma" VALUE="no-cache">
<CFHEADER NAME="Expires" VALUE="-1">

We do this so often we made a custom tag with those three commands.

Translate
LEGEND ,
Feb 26, 2010 Feb 26, 2010

Don't cache the pages.

Translate
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
Guest
Mar 02, 2010 Mar 02, 2010

Thanks for replying, but I haven't solved the problem yet.

Are pages cached by default ? I'm asking since I didn't do anything to cache them.

I looked the caching subject up on the CF documentation but couldn't come out with a solution: does it have to do with using the cfflush tag maybe ?

Thanks

Giovanni

Translate
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 ,
Mar 02, 2010 Mar 02, 2010

Pages are cached by default.  The following three commands will make them not cache.

<CFHEADER NAME="Cache-Control" VALUE="no-cache, no-store, must-revalidate">
<CFHEADER NAME="Pragma" VALUE="no-cache">
<CFHEADER NAME="Expires" VALUE="-1">

We do this so often we made a custom tag with those three commands.

Translate
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
Guest
Mar 02, 2010 Mar 02, 2010

It works !

Thank you !

Giovanni

Translate
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
Engaged ,
Mar 16, 2010 Mar 16, 2010

Hmmm... ... I remember that there is something about using redirects that will zap the "back" linkages.  But I cannot for the life of me remember what it was ...

Translate
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
Valorous Hero ,
Mar 16, 2010 Mar 16, 2010
LATEST

TLC-IT wrote:

Hmmm... ... I remember that there is something about using redirects that will zap the "back" linkages.  But I cannot for the life of me remember what it was ...

It's not that redirects zap the back linkages, but that they are part of the back history chain.  Thus you hit the back button return to the redirect URL which again redirects you to the page you just tried to leave with the back button, causing an endless loop, unlsss the user manages to skip over the redirect item in the back history.

Translate
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