How do I kill session variables

Results 1 to 4 of 4

Thread: How do I kill session variables

  1. #1
    Join Date
    Dec 1969
    Posts
    6

    Default How do I kill session variables

    In an ASP page I&#039m writing code like:<BR><BR>&#060;%set session("obj") = server.CreateObject("mydll.myclass")&#037;&#062;<B R><BR>After using the procedures in the dll, at the end I have a HOME button which takes me to the main menu page.<BR>Under the Clicked code I&#039m writing-<BR><BR>set session("obj") = nothing<BR>response.redirect("homepage.asp")<BR><B R>My intention is to destroy the object.But when I check for Not Isempty(session("obj")) it still remains notempty.<BR><BR>How do I deal with this problem?What exactly does set...nothing do here?

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: How do I kill session variables

    If you no longer need any of your session varibles you could use <BR><BR>Session.Abandon<BR><BR>This ends the session and the session varibles.<BR><BR>Pete

  3. #3
    Join Date
    Dec 1969
    Posts
    6

    Default RE: How do I kill session variables

    From what I understand session.abandon releases all the session variables of that session. But I need some session variables to exist like the username and password.<BR>So I want only a part of the group of variables to be released.<BR>Please tell me how I can do this.

  4. #4
    Join Date
    Dec 1969
    Posts
    27

    Default RE: How do I kill session variables

    Your could explicitly kill the variables for the session<BR>like Set Session("somevariable") = Nothing<BR><BR>This will let you keep the rest and release only the ones u want <BR><BR>Regards<BR>Shyam


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •