473,651 Members | 2,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stale Forms

Hello,

This topic has bugged me for years.

The ideal for handling web forms
would be that submitting the form
replaces the browser history's current
url with the url resulting from
the form processing code Response.Redire ct url

this can be achieved for links using
client-side dom "location.repla ce()"

however i can't see a way of doing it
for forms?

i am trying to stop people pressing "back"
and seeing old forms and then clicking submit

although i can easily detect this at the server
and stop any damage etc. the perfect solution
would be to stop the stale form from existing
on the client

also using Response.Expire s works but i feel it
is bad practice to force a roundtrip when somebody
is pressing back, and may not be interested in that
page but one further back

the way i stop stale forms from being an issue
on the server is to give each form state context
an id and sequence number which must match
the next post

you can make this strong by sticking a digest of the url
plus a secret onto the end of the url, ie:

page.asp?id=1&s eq=4&hash=84738 9473987439

or even lock it down further by including the referer url
in the digest

all of this is ok for protecting server from damage
but what about cleaning up all those stale forms
in the browser history?

the ideal would be something like:

form.submitWith Replace();

i am surprised it isn't an option in HTML itself:

<form action="page.as p" method="post" replace="yes">

as once a form has been submitted it rarely has any
value to anybody?

Nov 19 '05 #1
1 1613
hi john,
i know what you mean, it is a bit of a pain to have an invalid browser
history.
especially considering that we are now in the realm of web applications,
rather than collections of informational web pages. however that is the
model we still have to work with and back/forward will be with us for the
foreseeable future, with all of it's side effects in the web application
paradigm.

one way i use to work around this problem, is to call
Response.Redire ct(Request.Url. PathAndQuery) at the end of my postback code
(provided the user should stay on the same page, i.e. tyipcal datagrid
scenario). this has the effect of replacing the current page in the browser
history, which i think is what you want.
if you test this out on a web form that has a button. at the end of the
button_click code, redirect the user to the same page, and you'll see that
there is no option to go back or forward in the browser history. it has the
added advantage of not allowing form re-posts. and the user can refresh the
page without getting hung up on "repost the data?".

it doesn't work for redirecting to other pages though. i think .net 2.0 and
vista have some improvements for the web application model. the "navigator
app" supports forward and backward browsing, but there is another type
(forget the name) that doesn't allow back/forward functionality. you can
choose the type at compile time as far as i recall.

this probably won't solve your problem but i thought i would reply anyway.
tim

--------------------------
blog: http://tim.mackey.ie

"John Rivers" <fi*****@btinte rnet.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hello,

This topic has bugged me for years.

The ideal for handling web forms
would be that submitting the form
replaces the browser history's current
url with the url resulting from
the form processing code Response.Redire ct url

this can be achieved for links using
client-side dom "location.repla ce()"

however i can't see a way of doing it
for forms?

i am trying to stop people pressing "back"
and seeing old forms and then clicking submit

although i can easily detect this at the server
and stop any damage etc. the perfect solution
would be to stop the stale form from existing
on the client

also using Response.Expire s works but i feel it
is bad practice to force a roundtrip when somebody
is pressing back, and may not be interested in that
page but one further back

the way i stop stale forms from being an issue
on the server is to give each form state context
an id and sequence number which must match
the next post

you can make this strong by sticking a digest of the url
plus a secret onto the end of the url, ie:

page.asp?id=1&s eq=4&hash=84738 9473987439

or even lock it down further by including the referer url
in the digest

all of this is ok for protecting server from damage
but what about cleaning up all those stale forms
in the browser history?

the ideal would be something like:

form.submitWith Replace();

i am surprised it isn't an option in HTML itself:

<form action="page.as p" method="post" replace="yes">

as once a form has been submitted it rarely has any
value to anybody?

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1532
by: Jeff Nokes | last post by:
Hello, I'm using Cache::SharedMemoryCache with an Apache 1.3.28 / mod_perl 1.28 / Mason instance on RedHat Linux 7.2. The caching mechanism seems to work fine, it creates one shared memory segment and one semophore when in use. What I noticed was that when I gracefully shut apache down (completely), the segment and semaphore remain. I believe this is mostly intentional from design, but I would like to be able to remove any shared...
3
2277
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of master form. Method 2 opens the form but when I right click on the Notify Icon I don't get the context menu that I should be seeing. I can interact with the main form window but I cannot interact with the NotifyIcon. Method 2 gives a object reference...
7
2467
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls each with a couple of controls in them I then rebuilt my project and my new panels and all controls they contained are gone... I've looked through the Auto generated code but don't see anything that looks wrong Any body have any idea why this...
13
5566
by: MD | last post by:
I have been converting a program from VB6 to VB.Net and enhancing it as well. All has been progressing OK although its been hard work. Now, all of a sudden, when I try to execute a ShowDialog() on one of my forms I get "An unhandled exception of type 'System.ExecutionEngineException' occurred in system.windows.forms.dll". I can't work out what has caused this, and can't find any help on the Microsoft site or anywhere else on the web. ...
3
1635
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. This work fine for most cases, allowing the user to resize the form (and controls within the form. The forms them selves are create dynamically when the user drags a node from a listview to a panel (contained in a Usercontrol which is hosted by...
1
1861
by: Jonathan N. Little | last post by:
With all the security concerns and folks disabling JavaScript and cookies I converted my site to PHP. Originally I use session cookie to keep track of items our patrons selected on our gallery for checkout. Since the cookie was just in the clients browser memory, garbage collection was simple. Now with PHP sessions, patrons now do not have to have cookies enabled to shop on our site, but since this is not a 'log on' and 'log off' situation...
3
5899
by: petermichaux | last post by:
Hi, I am trying to put together the last major pieces of my project's puzzle. This is more website/client-side architecture than JavaScript syntax but I hope this is a good place to ask. I'm a little stumped with which direction to take and advice would be greatly appreciated. I think this is a generally interesting problem but I haven't seen a post this long here before :S I have developed half of the admin interface for an e-commerce
2
2349
by: Ulrike Klusik | last post by:
Hello Folks, i've got two structural identical tables (including tablespace and indexes) with identical data, on which the access path of an SQL is differs. But I don't see a reason for the different behaviour. Both tables are allocated in the same database and storage space and use the same buffer pool. The DB2 subsystem is Version7.1 on z/OS. On both tables I've run REORG with standard statistics. I've checked for stale statistics...
4
2344
by: bodhiSoma | last post by:
I've got this weird problem. I'm connecting to MySQL via PHP, querying a particular table, closing the connection then parsing and displaying the results. I then modify the table but when I reload the PHP page, the output does not reflect this change. Viz: -------- mysqlselect * from users; +----------+
0
8361
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8278
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8584
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.