INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to use Session.Abandon?

How to use Session.Abandon?

(OP)
Hi,

Can you tell me why this not works:
<%
Session("abc")="abc"
response.write "Session(""abc"") = " & Session("abc") & "<br>"
Session.Abandon
response.write "After Session.Abandon, Session(""abc"") = " & Session("abc") & "<br>"
%>
The output is:
Session("abc") = abc
After Session.Abandon, Session("abc") = abc

RE: How to use Session.Abandon?

The session variables are not destroyed until the script has completed and exited.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: How to use Session.Abandon?

(OP)
Session("abc") looks like a function: when we call the function, the function gets the session value and returns it? No??

RE: How to use Session.Abandon?

Abandon() is an 'empty' method, it takes no parameters and does not return a value. It's only purpose is to tell the server to destroy the current session as soon as the script ends rather than waiting for the session to timeout. Useful for making sure that a logout occurs when the user closes their browser instead of it staying active for 20mins.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: How to use Session.Abandon?

(OP)
Thanks a lot for your help!!

RE: How to use Session.Abandon?

I think you can buffer the output. So, the server will hold back on dishing anything out until it has run the entire script. I think that will allow you to pull of your script.

<%response.Buffer=true%> needs to go at the beging of your page.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close