Wrox Programmer Forums
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic 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 September 26th, 2003, 08:03 AM
Authorized User
Join Date: Aug 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session Variable Problem

The problem is simple...can u pls tell me the reason
A simple code is here:
Session("Name") = "ABC"
Response.write "After creating session variable name...its value = "&Session("Name")

response.write "After destroying Session variable name...its value = "&Session("Name")
---Even after abandoning the Session still it gives "ABC"
---What might be the reason..pls help me out

Old September 26th, 2003, 08:11 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

When you call Session.Abandon, the Session variables are still available in the current page.

It's usually a good idea to have Session.Abandon followed by a Response.Redirect instruction, for example to a page called Logout.asp (to inform the user they have ended their session) or to the home page or any other page.

This way, you can be sure that the Session variables are no longer accessible.



Imar Spaanjaars
Everyone is unique, except for me.
Old October 9th, 2003, 10:49 AM
Authorized User
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts

How i had the same problem i decided to do the next thing

Session("varName") = ""

and after that


Old February 15th, 2004, 12:28 PM
Registered User
Join Date: Jan 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

   Try out this .

     When a user clicks log out then redirect him/her to a signout.asp page where the code mustbe like this

  and a again redirect him/her to the destination page. I had used the same logic in my website and i am sure it working


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with session variable prabhatsriva01 ASP.NET 2.0 Professional 3 May 10th, 2007 11:41 AM
Session Variable Problem caterpillar General .NET 0 August 17th, 2006 11:26 AM
Another Session Variable Problem jim.sullivan@telus.net Classic ASP Databases 1 August 1st, 2004 03:58 AM
Session Variable Problem leo_vinay Classic ASP Professional 1 October 1st, 2003 10:51 PM

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