473,322 Members | 1,703 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.

Forms Authentication

Hi,

I am working with forms authentication, so when the user leaves the
application pushing the exit option the program execute the following
instrucctions:

FormsAuthentication.SignOut()
Response.Redirect("login.aspx")

but, when the user leaves the application pushing the close button of the
navigator (placed at the right top of the screen) the instrucctions won't be
executed.

Is there any way to catch this event in order to make the execution of the
above instructions ??

I would really appreciate your helping me...!

Thanks in advance....!

Boris
Nov 17 '05 #1
2 5732
Boris,

That's a client-side event (onunload of the <body>) that you would capture,
and since HTTP is connectionless, you won't be able to run your code. You
can do it by having a client-side event take you to an ASPX page that runs
code to sign the user out, but you wouldn't want to do that because it
would run when the user navigates away from the page as well.

You're not going to be able to do this. You cannot rely on the Session_End
firing when the user closes the browser. In fact, it won't. It will only
fire when the session expires or if you call Session.Abandon.

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Reply-To: "Boris Condarco" <bc*******@sbef.gov.bo>
From: "Boris Condarco" <bc*******@sbef.gov.bo>
Subject: Forms Authentication
Date: Tue, 29 Jul 2003 15:00:05 -0400
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <uS*************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 166.114.44.250
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:163109
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi,

I am working with forms authentication, so when the user leaves the
application pushing the exit option the program execute the following
instrucctions:

FormsAuthentication.SignOut()
Response.Redirect("login.aspx")

but, when the user leaves the application pushing the close button of the
navigator (placed at the right top of the screen) the instrucctions won't beexecuted.

Is there any way to catch this event in order to make the execution of the
above instructions ??

I would really appreciate your helping me...!

Thanks in advance....!

Boris


Nov 17 '05 #2
Thanks a lot guys for helping me to clear the concepts above

"Jim Cheshire (MS)" <ja******@online.microsoft.com> wrote in message
news:Yt**************@cpmsftngxa06.phx.gbl...
Boris,

That's a client-side event (onunload of the <body>) that you would capture, and since HTTP is connectionless, you won't be able to run your code. You
can do it by having a client-side event take you to an ASPX page that runs
code to sign the user out, but you wouldn't want to do that because it
would run when the user navigates away from the page as well.

You're not going to be able to do this. You cannot rely on the Session_End firing when the user closes the browser. In fact, it won't. It will only
fire when the session expires or if you call Session.Abandon.

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Reply-To: "Boris Condarco" <bc*******@sbef.gov.bo>
From: "Boris Condarco" <bc*******@sbef.gov.bo>
Subject: Forms Authentication
Date: Tue, 29 Jul 2003 15:00:05 -0400
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <uS*************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 166.114.44.250
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:163109X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi,

I am working with forms authentication, so when the user leaves the
application pushing the exit option the program execute the following
instrucctions:

FormsAuthentication.SignOut()
Response.Redirect("login.aspx")

but, when the user leaves the application pushing the close button of the
navigator (placed at the right top of the screen) the instrucctions won't

be
executed.

Is there any way to catch this event in order to make the execution of theabove instructions ??

I would really appreciate your helping me...!

Thanks in advance....!

Boris

Nov 17 '05 #3

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

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
1
by: MJ | last post by:
I'm building an application that has a file structure similar to the following: /myapp/user_login.aspx /myapp/user_page_1.aspx /myapp/user_page_2.aspx /myapp/user_page_3.aspx...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
2
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
7
by: Justin | last post by:
I am trying to password protect a subdirectory using forms authentication. I am using the "Location" tag to specify the directory to be protected. The login.aspx page is in the root directory of...
4
by: =?Utf-8?B?R3V1czEyMw==?= | last post by:
Hi, I created a web site on a remote server. To logon the user must enter a user id and password. The site is uses Forms Authentication. The web config file looks as follows: ...
4
by: Bjorn Sagbakken | last post by:
In a web-application with login creds (user, pwd), these are checked against a user table on a SQL server. On a positive validation I have saved the userID, name, custno and role-settings in a...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
1
by: Sean | last post by:
Hi, I've taken over a website, which has an admin section that is currently open. I added Forms Authentication to the admin directory with the using the location section in web.config: ...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.