Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 February 23rd, 2004, 09:28 PM
Registered User
 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default refreshing session variables?

Can someone please help with this problem?

Go to www.votawtool.com and use "12345" to test the situation below. (without the quotes)

In the upper right is a text box for dealer login. When the dealer enters their account number, discount pricing is "turned on" and recorded in session variables. Then the line, "Dealer Net Pricing is turned on. Turn off", is shown in place of the login text box. The following is used to show/hide this:

If session("dealer")="true" Then
    show the line
Else
    show the login form
End if

When someone clicks "turn off", the page goes to a logout page with the following:

session("dealer") = ""
session.abandon
response.cookies("dealer") = ""
strURL = Request.ServerVariables("HTTP_REFERER")
Response.Redirect strURL

So, the session is abandoned, and then the person is redirected back to the page they were on and the login text box once again shows on that page.

HOWEVER, the problem comes in when they go to another page after logging in or out. It does not show the new state of session("dealer"), i.e. the login form shows when the "Dealer Net Pricing is turned on. Turn off" should show and vice versa.

How do I get this sorted out? I've tried auto refreshing the page by putting meta tags in the <head> ------
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
but it still isn't working. (The "about us" page currently has the meta tags)

Can anyone offer a suggestion?

Thanks,
Mickey
 
Old February 23rd, 2004, 09:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Mickey, when viewing the site it behaved as you said it should,
ie.
When I was logged in all the pages showed me as logged in:"Dealer Net Pricing is turned on. Turn off"
When I logged out all pages showed me the dealer login textbox.



======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old February 23rd, 2004, 09:40 PM
Registered User
 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well heck. Maybe I need to clear my cache or reboot.

.....I'll be back.

Thanks,
Mickey

 
Old February 23rd, 2004, 09:43 PM
Registered User
 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rod,
Thanks for responding.

Did you log in and click on all the tabs of the main navigation and then log out and click on all the tabs again?

Thanks,
Mickey
 
Old February 23rd, 2004, 09:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Yeah, just a tick I'll do it again.


======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old February 23rd, 2004, 09:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Hmmm, you're right , sorry about that, I was sure it was behaving correctly but now it seems not to.



======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old February 23rd, 2004, 10:00 PM
Registered User
 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Shux. I was hoping it was just my machine.

Oh well. Thanks anyway.

Any suggestions anyone?

Thanks,
Mickey
 
Old February 25th, 2004, 05:48 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

I would insert an SSI at the top of each page for verification purposes that runs whenever a page is loaded. The include could be something like this...

<%
response.buffer = true
if Session("Dealer") = "" then
response.redirect "login.asp"
end if
%>






Similar Threads
Thread Thread Starter Forum Replies Last Post
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 flesh_god Dreamweaver (all versions) 7 November 11th, 2003 05:52 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.