473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Session variable usage?

Is there a way to use a Session Variable to prevent
the successful resubmission of a form if the user
uses the Back button and tries to submit it again?

Thanks in advance.
Jul 22 '05 #1
6 1292
have a look on www.aspfaq.com
There are some good explanations of how to properly adjust for the back
buttons usage.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ht********************@comcast.com...
Is there a way to use a Session Variable to prevent
the successful resubmission of a form if the user
uses the Back button and tries to submit it again?

Thanks in advance.

Jul 22 '05 #2
Um, yeah. On the form page:

<%
if request.form("whatever") <> "" and not (session("already_submitted"))
then
' do your thing with the data
session("already_submitted") = true
else
' form was empty, or already submitted
end if
%>

--
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.


"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ht********************@comcast.com...
Is there a way to use a Session Variable to prevent
the successful resubmission of a form if the user
uses the Back button and tries to submit it again?

Thanks in advance.

Jul 22 '05 #3
Yeah, you could do that if you want, I suppose.

<% If Session("AlreadySubmitted") = "" Then %>
<form method="post" action="yourpage.asp">
<% Else %>
Already submitted
<% End If %>

You'd want to use that in conjunction with anti-caching headers.

http://www.aspfaq.com/show.asp?id=2017
http://www.aspfaq.com/show.asp?id=2022

Ray at work

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ht********************@comcast.com...
Is there a way to use a Session Variable to prevent
the successful resubmission of a form if the user
uses the Back button and tries to submit it again?

Thanks in advance.

Jul 22 '05 #4
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:#3**************@TK2MSFTNGP09.phx.gbl...
Yeah, you could do that if you want, I suppose.

<% If Session("AlreadySubmitted") = "" Then %>
<form method="post" action="yourpage.asp">
<% Else %>
Already submitted
<% End If %>

You'd want to use that in conjunction with anti-caching headers.

http://www.aspfaq.com/show.asp?id=2017
http://www.aspfaq.com/show.asp?id=2022

Ray at work


Thanks to all; especially Ray as it was the "anti-caching headers"
approach that I needed.

I misstated my problem as I had solved that one yesterday;
I basically came up with Aaron's solution.

Today's problem was, basically, how to prevent the user from
backing in to a secure page after logging out.

Jul 22 '05 #5
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:us**************@TK2MSFTNGP14.phx.gbl...
Um, yeah. On the form page:

<%
if request.form("whatever") <> "" and not (session("already_submitted")) then
' do your thing with the data
session("already_submitted") = true
else
' form was empty, or already submitted
end if
%>

--
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.


I wondered why you added:

Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.

until I saw it was your response to "error message" so I'll ignore it :)
Jul 22 '05 #6
> I wondered why you added:

Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.


It's just my signature. Most of my time is spent in the SQL Server groups,
where a gentle reminder is not enough to drive this point home. I figure
the more exposure this page gets, the fewer questions we'll get that start
with "I have this table with a couple of varchar columns..."

--
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
Jul 22 '05 #7

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

Similar topics

1
by: Mario | last post by:
If there is an associated memory cost for using session variables, can the memory used be reclaimed on an ASP page by setting the session variable to undefined or null? If on the same ASP page you...
1
by: Christian Perthen | last post by:
Hi, How can a measure server session memory usage? I have a 20-30 session variables and I would like to know how much they memory they consume then multplied with my projected user load. ...
3
by: Brian Henry | last post by:
Is there anyway to when the users loggin session expires (we have it set to expire after 15minutes of no usage) show a "session expired" message page when they try to navigate the site after it did?
15
by: dee | last post by:
Hi, What is the maximum number of minutes for Session timeout that I can specify in web.config? Thanks. Dee
2
by: Hardin | last post by:
I have an app that uses the sessionID to track user navigation and usage through the application. It works fine except in one case: There is a point in the application where I want to "close"...
13
by: Nagib Abi Fadel | last post by:
Is it possible to create a session variable for each user in Postresql ?? Thx
1
by: Mike McDonald | last post by:
I am trying to free up some memory by forcing a session.clear and a session.abandon. When I startup the application, it starts at about 80,000 KB of memory in the aspnet_wp.exe. I am able to...
1
by: Larry Neylon | last post by:
Hi, I'm working on a VBScript application on IIS6 and I'm looking for some advice about the best way of replacing or improving session variable usage. The application is in a secure extranet...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...

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.