473,486 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Session.abandon and Session.Cleear: what is the difference

What is the difference between Session.Abandon and Session.Clear?
Thank you.

Nov 19 '05 #1
3 3693
Session.Clear stays in the same session.
Session.Abandon dumps the current session and starts a new session.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<JJ****@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
What is the difference between Session.Abandon and Session.Clear?
Thank you.

Nov 19 '05 #2
Session.Abandon() will end current session
Session_End will be fired and next request will fire Session_Start

Session.Clear will just clear the session data , the session is still alive

Session ID will remain same in both cases, as long as the browser is not
closed.
"JJ****@hotmail.com" wrote:
What is the difference between Session.Abandon and Session.Clear?
Thank you.

Nov 19 '05 #3
Thank you - my further question,s what is recommended in terms of
clearing any session variables in the context of:
1. on error, I want any session variables cleared and the user
redirected to a logon page
( I wish to prevent a user from reentering the error page and
recreating the original error)
3. I wish to prevent others from "backing" into web pages if a user
does not log out and session timeout has not yet occurred.

I have the web pages set so that the browser will not cache them

It kind of sounds like I just need Session.clear, but I have been using
Session.Abandon.

MY thanks!

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2659
by: RC | last post by:
hi, I now got a session ID. I want to try to resume a session by closing the current browser and open a new one. Then pass the session ID in URL query string on new browser to resume the...
4
1867
by: Hugo Flores | last post by:
Hi all, I noticed that there are three methods that can remove session variables Session.Clear() Session.RemoveAll() Session.Abandon() Now my question as is stated on the subject, what is...
4
11229
by: ad | last post by:
I use the Login controls of Asp.net 2.0 in my program. I want to logout a user by program, I try Session.Abandon() for this. But I found that the user is the same after I execute Session.Abandon()....
10
2164
by: Li Pang | last post by:
Hi, I created a html page from which I give a link to another web site. The new site is opened in a new window. When I opened multiple windows, they all have the same SessionID. I want ot know...
1
6858
by: pulaki | last post by:
Greetings and thank you! I am passing form data to a distant server that is out of my control. The destination server (posting to) rejects all postings beyond ONE from the same session ID. I...
0
1254
by: 'Mani | last post by:
Hi All, I need to abandon a different session and want to know how to do this. Session.Abandon() will abndon only the current session associated with the current request. But, my necessity is...
4
307
by: lalit | last post by:
Hi every one I m storing a value in session like session = some value then I am checking evrery page onLoad that if this session == Null then Send to login page. It does that but If I open a new...
2
1481
by: Nathan Sokalski | last post by:
I have an application that is using Session state. On one page, I use the Session.Add() method to create the Key/Value pair for the first time. I am then sent to another page using...
16
1801
by: Jonathan Wood | last post by:
Greetings, I was wondering if anyone here has a good understaning of the Session object. I know there are options like the Session.Abandon method and the regenerateExpiredSessionId setting,...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.