473,387 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Session.Abandon() can't logout

ad
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().

I thought that Session.Abandon() can break the connection of current user,
but I fail

How can I logout a user by program?
Nov 19 '05 #1
4 11224
ad wrote:
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().

I thought that Session.Abandon() can break the connection of current user,
but I fail

How can I logout a user by program?


You would rather invoke
System.Web.Security.FormsAuthentication.SignOut().

Forms authentication uses cookies. This method will remove the cookie
from the browser.

I have barely touched ASP.NET 2.0 but this method is supported in both
framework 1.0, 1.1 and 2.0.

Correct me if I am wrong!

--
Emil Christopher Melar
Nov 19 '05 #2
Never worked with ASP.NET but have 2 educated guesses where is the problem.

1. Session.Abandon only takes effect after page is completely executed. So the current page that called Abandon still has that same session. All next browser calls will be on a new Session

2. Is it possible that you are using AutoLogin feature. It will immediately log you back in as soon as you logout.
George.
"ad" <fl****@wfes.tcc.edu.tw> wrote in message news:uy**************@tk2msftngp13.phx.gbl...
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().

I thought that Session.Abandon() can break the connection of current user,
but I fail

How can I logout a user by program?
Nov 19 '05 #3
ad
Thanks,
Your are correct!
SignOut() really can logout a user!

What about Session.Abadon()?
What dose it can do for us?


"Emil Christopher Melar" <emil@no_spam_arpanet.no>
???????:%2****************@TK2MSFTNGP12.phx.gbl...
ad wrote:
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().

I thought that Session.Abandon() can break the connection of current
user, but I fail

How can I logout a user by program?


You would rather invoke
System.Web.Security.FormsAuthentication.SignOut().

Forms authentication uses cookies. This method will remove the cookie from
the browser.

I have barely touched ASP.NET 2.0 but this method is supported in both
framework 1.0, 1.1 and 2.0.

Correct me if I am wrong!

--
Emil Christopher Melar

Nov 19 '05 #4
authenication and session are different. authenication is who the user is.
session is a way to attach server state information to a browser session.
they are indepentant of each other and neither requires the other.

so session abandon frees the session data only.

-- bruce (sqlwork.com)

session abandon, clears the session
"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
Thanks,
Your are correct!
SignOut() really can logout a user!

What about Session.Abadon()?
What dose it can do for us?


"Emil Christopher Melar" <emil@no_spam_arpanet.no>
???????:%2****************@TK2MSFTNGP12.phx.gbl...
ad wrote:
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().

I thought that Session.Abandon() can break the connection of current
user, but I fail

How can I logout a user by program?


You would rather invoke
System.Web.Security.FormsAuthentication.SignOut().

Forms authentication uses cookies. This method will remove the cookie
from the browser.

I have barely touched ASP.NET 2.0 but this method is supported in both
framework 1.0, 1.1 and 2.0.

Correct me if I am wrong!

--
Emil Christopher Melar


Nov 19 '05 #5

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

Similar topics

1
by: Random | last post by:
I have an <asp:LinkButton runat="server" id="btnLogin"/> control that I use in my page header for login/logout link. Depending on the session state when the page loads, I set the .Text and...
4
by: Andy Fish | last post by:
Hi, I have an asp.net application that is using Forms Authentication and maintaining http session state using cookies in the normal way. when the user clicks the logout button I do this: ...
2
by: Hillary Hill | last post by:
I have a login page written in ASP. Once the user logs in to the system, by clicking the certain link they can navigate to the purchase module written in ASP.Net. In the purchase module the user...
2
by: Paul W | last post by:
Using default session handling (ie. inproc and with cookies). I have a 'logout' button that returns the user to the login screen and does a session.abandon. HOWEVER, if they then log back in...
0
by: js | last post by:
In my project I have both ASPX and classic ASP. Four things in question are the entry page(Main.aspx), the logon page(logon.ASP), .Net Session, legacy ASP Session. The Main.apsx contains a Logon...
1
by: ad | last post by:
I am using the UserControls of VS2005 to verify user login, and I use Session to cache some user's data. Will the session data will be clean when user logout then login immediately?
6
by: Bhagya | last post by:
Hello, On the LogOut Page i have done Session.Abandon(); And on every Page, In the Page_Load Event i check if the session exists and only then display data. Now the problem is after i logout from...
4
by: =?Utf-8?B?Rmxhc2hNZXJsb3Q=?= | last post by:
We're using C# & VS 2005. In our app ... someone is "logged-in" if Session("companyID") exists and is non-zero. How do we implement a "Logout" button that signs off session, sets...
1
by: gnewsgroup | last post by:
I am using forms authentication for a web application. Like many other member web application, my web application prints out Welcome! John Doe (Logout) on the top right corner of each...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.