Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Prevent expired POST results (Was: Control the window)


  • From: peter at brunone.com (Peter Brunone)
  • Subject: [Javascript] Prevent expired POST results (Was: Control the window)
  • Date: Wed Aug 30 11:39:41 2006

		Ooh, I like that.  Nice, functional, and fully server-side.

I assume they could just hit the Back button twice to get to the post page... but then again, you could get really clever and use location.replace for your GET... or would that still be considered part of the original POST request?

Peter

				From: Scott Reynen scott@xxxxxxxxxxxxxxx

On Aug 29, 2006, at 9:54 PM, Peter Lauri wrote:

> The only real reason for this is that I do not want them to use the 
> back
> button when the system have posted information, they then get the 
> "page has
> expired" message.
>
> How can I avoid this then? :)

I solve this problem by redirecting POST to GET. When data is 
posted, I generate the resulting HTML, save it to a database, and 
immediately redirect to a GET request for the database record I just 
created. The POST will not show up in the history, and the HTML 
result of the POST request will only expire when I decide to remove 
it from the database. Much less annoying than breaking the back button.

Peace,
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.LaTech.edu/pipermail/javascript/attachments/20060830/68376ca2/attachment.html