Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

How to stop back button on e commerce site

Posted 21 Dec 2004 23:26:53
1
has voted
21 Dec 2004 23:26:53 Greg LeBreck posted:
Hey guys in ASP I have a shopping site. When a customer processes and order they are taken to a reciept page and thier cart is cleared. Works good, but if the customer were to hit their back button, they could potentially process the order again.

Is there anyway to stop this?

I know I have seen sites that when you process an order and then hit the back button you get a pop up that says Content Expired, and if you hit refresh it just bounces to another page.

How do I do this?

Replies

Replied 21 Dec 2004 23:32:21
21 Dec 2004 23:32:21 Greg LeBreck replied:
Forgot to add. The cart is stored in a cookie. and the cookie is cleared when processed.

Edited by - Nix Neon on 21 Dec 2004 23:33:00
Replied 24 Dec 2004 01:28:05
24 Dec 2004 01:28:05 Rene Bandsma replied:
Why not use a session?
Replied 30 Dec 2004 20:47:16
30 Dec 2004 20:47:16 Daniel Severns replied:
Greg,

Here is an idea...
Give each order a unique ID like a counting PKID and do not allow duplicates.
I know Dreamweaver has a function that checks to see if the same information exists, you could use that type of functionality to check to see if you uniqueID already exists and if the press back then, they could be redirected to another page?

Im not sure if that even made sense, let me know if i need to elaborate.

--------------------
MtnManDan

I dont really know what im talking about <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 30 Dec 2004 20:48:32
30 Dec 2004 20:48:32 Daniel Severns replied:
Crap, your not using a database, are you?

--------------------
MtnManDan

I dont really know what im talking about <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 03 Jan 2005 02:42:41
03 Jan 2005 02:42:41 Simon Martin replied:
You <i>could</i> use something like
&lt;meta http-equiv="pragma" content="no-cache"&gt;
in the header... However the page will still be cached in the browsers temporary internet files; thankfully those helpful chaps at microsoft have provided this answer support.microsoft.com/kb/222064/EN-US/

Might be helpful if you don't go with Daniel's idea

Live the life you love
Love the life you live

Simon

[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
Replied 06 Jan 2005 18:26:56
06 Jan 2005 18:26:56 Ajay Patel replied:
try this code, it won't disable the back button on the browser, however the page will not display when a user attempts to go back, put it at the top of hte page you don't want to cache

&lt;%
' Disable Caching
pStr = "private, no-cache, must-revalidate"
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", pStr
%&gt;

Reply to this topic