473,493 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 5774
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
4790
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
2481
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
4835
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
2481
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
4191
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
2020
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
424
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
5312
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
3525
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
2559
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
7119
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
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3088
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
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
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 ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
285
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.