Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 23rd, 2004, 09:28 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old February 23rd, 2004, 09:37 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
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.
======================================
Reply With Quote
  #3 (permalink)  
Old February 23rd, 2004, 09:40 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
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

Reply With Quote
  #4 (permalink)  
Old February 23rd, 2004, 09:43 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
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
Reply With Quote
  #5 (permalink)  
Old February 23rd, 2004, 09:45 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
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.
======================================
Reply With Quote
  #6 (permalink)  
Old February 23rd, 2004, 09:56 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
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.
======================================
Reply With Quote
  #7 (permalink)  
Old February 23rd, 2004, 10:00 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
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
Reply With Quote
  #8 (permalink)  
Old February 25th, 2004, 05:48 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Minneapolis, MN, USA.
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
%>

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.