Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 28th, 2007, 11:02 AM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session variables on Back

Hopefully someone can help me out, I've not been able to find an answer to this question.

When a user on my site proceeds forward (say from page 3 to page 4), I have a bunch of Session variables that are set on page 4, from the values in the form on page 3. But if that user needs/wants to go back to page 3, I have some Java Script that fires on page 3's load that displays certain fields depending on a value that is stored in the Session variables. But when the user hits the Back button, those Session variables are not getting passed to the Java Script, they are just blank. Here's how I'm passing the variables:

Response.Write("<script language=""javascript"">checkPayment('" & Session("School") & "', '" & Session("CC") & "');</script>")

When I do an alert(); statement in the Java Script function on these variables, I just get "None".

Any ideas?

-aingals

 
Old April 28th, 2007, 11:20 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to add this to the top of page 3:

<%
  Response.Expires = 0
  Response.ExpiresAbsolute = Now() - 100
  Response.AddHeader "pragma","no-cache"
  Response.AddHeader "cache-control", "private"
  Response.CacheControl = "no-cache"
%>

This forces the browser to get a new version of the page from the server every time it's requested, including loading the page from a browser's Back button click.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
clear all session variable whenusing browser back nax111 ASP.NET 1.0 and 1.1 Professional 0 November 20th, 2006 04:17 AM
Session Variables testsubject Visual Studio 2005 8 March 8th, 2006 04:26 PM
Is it possible for me using session variables into see07 ASP.NET 1.x and 2.0 Application Design 4 March 9th, 2005 07:46 PM
Session Variables - help? Annoyamouse BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 11 August 31st, 2004 03:56 PM
session variables help face Classic ASP Databases 4 September 12th, 2003 03:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.