473,386 Members | 2,129 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,386 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 5754
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.