Click to See Complete Forum and Search --> : Checking if the session ends on the form submit
telmessos
08-28-2008, 03:54 PM
Hi All,
I have a form and it is going to a bank's secure credit card payment service. According to the reply coming from that system my code is writing the information kept in the session to the database or not. When the client submits the form I want a script check if the session time out passed. If it is passed instead of submitting the form give a warning. If not, proceed.
Any idea?
Thanks
telmessos
Kuriyama
08-28-2008, 04:00 PM
"According to the reply coming from that system my code is writing the information kept in the session to the database or not. When the client submits the form I want a script check if the session time out passed. If it is passed instead of submitting the form give a warning. If not, proceed."
What?
This makes no sense at all.
telmessos
08-28-2008, 04:20 PM
There is a form when the client submits, it goes to the bank's web site. The client enters the credit card info there. That page sends the result to another page on my server. What I want is on the form page, if the session is finished I want to stop the client submit the form.
For example:
The client comes to the form page started filling the form. And then for some reason they left the page open and go away. When they come back to the computer and press Submit button, I don't want the form submitted to the bank's page if the session is finished. Otherwise if they make the payment in the bank's page and come back to our server. Session will be finished and the previously entered form elements will be lost. I just don't want them to submit the form if the session finished.
I hope I could clarify it.
Thanks
Kuriyama
08-28-2008, 05:00 PM
Are you using any session objects throughout the site?
quick a dirty way here
At the beginning of the page do this
Session("isAlive") = "true"
Now before you send the form do this
If Session("isAlive") = "true" then
telmessos
08-29-2008, 04:49 AM
How can I run that on form submit?
Kuriyama
08-29-2008, 08:45 AM
Here is an example.
<%
session("isAlive") = "true"
if Request("submit") = "Submit" and session("isAlive") = "true"
'process the form
end if
%>
<form action="#">
<input type="text" name="stuff" value="whatever" />
<input type="submit" name="submit" value="Submit" />
</form>
Bullschmidt
09-07-2008, 05:42 PM
How can I run that on form submit?
And don't know if info about posting a page to itself might help at all:
Classic ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp
Or if the page posts to a separate page then you could check the session variable on the page that receives the post.