473,322 Members | 1,671 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,322 software developers and data experts.

How to "Log Off" a user

Using 1.1....
I have an application using Forms Authentication that, like all other such
applicaitons, uses FormsAuthentication.RedirectFromLoginPage to authenticate
a user.

at a point in time I want to "log off" that user meaning that I want that
user to no longer be authenticated and I would also like for the Session_End
event in global asax to trigger.

Is this possible?

--
Regards,
Gary Blakely
Apr 2 '06 #1
5 1961
System.Web.Security.FormsAuthentication.SignOut()

Sonu Kapoor

---
Posted via www.DotNetSlackers.com
Apr 2 '06 #2
signout does part of the job but the session_end does not execute in
global.asax. At least it is not doing it in my debug session.
--
Regards,
Gary Blakely
<Sonu Kapoor [MVP]> wrote in message
news:u1**************@TK2MSFTNGP11.phx.gbl...
System.Web.Security.FormsAuthentication.SignOut()

Sonu Kapoor

---
Posted via www.DotNetSlackers.com

Apr 2 '06 #3
Hi Gary,

As for the FormsAuthentication's authenticated user and the token, it has
no direct relation with the sessionState identity though be default their
idenitityall stores in cookie. So the SessionState's timeout event won't
fire when formsauthenticated user ticket get invalid. BTW, what're you
goind to do in session timeout event? If you just want to clear some
certain data in the sessionstate, you can manually define a function to
clear the session date which is called after you call the
Formsauthentication's Sigeout method.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 3 '06 #4
Steven,
I need to maintain a database table showing all currently signed on users to
our application. My first notion was to add a record on session begin and
delete their record on session_end (knowing that session_end is triggered
after so much idle time). then, when thinking about the Signout I thought
this would provide a more accurate timing than waiting for session_end.

BUT, only some users explicitly signout - most just kill their browser. So,
I guess I'll just use session_begin and session_end as I originally
intended.

--
Regards,
Gary Blakely

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:vJ**************@TK2MSFTNGXA01.phx.gbl...
Hi Gary,

As for the FormsAuthentication's authenticated user and the token, it has
no direct relation with the sessionState identity though be default their
idenitityall stores in cookie. So the SessionState's timeout event won't
fire when formsauthenticated user ticket get invalid. BTW, what're you
goind to do in session timeout event? If you just want to clear some
certain data in the sessionstate, you can manually define a function to
clear the session date which is called after you call the
Formsauthentication's Sigeout method.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 3 '06 #5
Thanks for your response Gary,

So you're wantting to count the current signon user. I think this is
something like counting the online users. Generally a common means is
maintain a global signon/online user list and there is a timestamp in the
list associated with each user in it. When the user request a server page
or do a postback, you can update that timestamp. Also, there is a
background thread or timer which always loop the list and check the
timestamp to see whether any one has been expired.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Apr 4 '06 #6

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

Similar topics

0
by: Jonathan Trevor | last post by:
Hi, Spent nearly 8 hours googling and trying code on this yesterday without much success. I'd like to write a .NET application (using .NET primitives, older Win32 calls, or WMI etc) to work out...
0
by: Klemens | last post by:
what do entry's like this in db2diag.log indicate? ------------------------------------------- 2004-01-14-09.07.52.650000 Instance:WWS Node:000 PID:3512(db2syscs.exe) TID:1116 ...
6
by: Fan Ruo Xin | last post by:
Last monday, I tried to create a working table, and failed because of 'Log Full'. There were two applications running at that time - one is autoload (during the split phase), another one is "insert...
3
by: Phil Sherman | last post by:
What is the relationship between the snapshot elements: Log pages written Number write log IOs Number partial page log IOs There doesn't appear to be any information in my PDF System monitor...
9
by: Mike Von Stein | last post by:
Maybe I'm missing something obvious, but if I several MDB's that use the same secure workgroup MDW file and the user logs into one of them is there a way through code that I can open other...
2
by: James | last post by:
User has a input as "SwitchName = ON" or "SwitchName = OFF", how to use C# Regex to get SwitchName and the value? Regex.Match(line, @"(\S+) = {ON|OFF}") does not work.
4
by: Gérard Talbot | last post by:
Hello fellow stylers, What would be the best CSS equivalent of MSIE's wrap="off" and wrap="hard"? hard Text is displayed with wordwrapping and submitted with soft returns and line feeds. ...
2
by: Tor Inge Rislaa | last post by:
I am prompted to implement the syntax below to be able to monitor the error on the remote server trough my browser (client). I can't seem to find where to place the code in my web.config file to...
0
by: Shiamak | last post by:
Hi , is there a way to use VB to add an existing user to "log on as a service" of local Security policy? i want to do this in VB /VB .net??? TIA
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.