Hi,
I am working with forms authentication, so when the user leaves the
application pushing the exit option the program execute the following
instrucctions:
FormsAuthentica tion.SignOut()
Response.Redire ct("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 2 5896
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.publi c.dotnet.framew ork.aspnet NNTP-Posting-Host: 166.114.44.250 Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1631 09 X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
Hi,
I am working with forms authentication, so when the user leaves the application pushing the exit option the program execute the following instrucction s:
FormsAuthentic ation.SignOut() Response.Redir ect("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
Thanks a lot guys for helping me to clear the concepts above
"Jim Cheshire (MS)" <ja******@onlin e.microsoft.com > wrote in message
news:Yt******** ******@cpmsftng xa06.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.publi c.dotnet.framew ork.aspnet NNTP-Posting-Host: 166.114.44.250 Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl Xref: cpmsftngxa06.ph x.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1631 09X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
Hi,
I am working with forms authentication, so when the user leaves the application pushing the exit option the program execute the following instrucction s:
FormsAuthentic ation.SignOut() Response.Redir ect("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
theabove instructions ??
I would really appreciate your helping me...!
Thanks in advance....!
Boris This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
Authentication set up and it worked just fine. Then I
realized that I needed to have some pages unsecure.
I then created 2 directories. One named Secure and the
other named Public. I placed my web.config file in my
|
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
/myapp/admin/admin_login.aspx
/myapp/admin/admin_page_1.aspx
/myapp/admin/admin_page_2.aspx
|
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 protected by forms authentication.
When I create forms authentication at root level it works but when I move my
code up to the subfolder I get this error:
Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
|
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 trouble getting the web.config to
work properly.
First I tried to have a second web.config in the sub directory with
authentication and authorization set to forms, but it blew up.
Next, I tried to modify the root web.config in the following manner...
|
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 Applications and
owner of Access Microsystems. Doug can be reached at
doug@accessmicrosystems.com.
--------------------------------------------------------------------------------
| |
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 the app. Here is the web.config:
<location path="Admin">
<system.web>
<authentication mode="Forms">
<forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30">
<credentials passwordFormat="Clear">
<user name="Admin"...
|
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:
<configuration>
<system.web>
<customErrors mode="Off"/>
|
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 userobject (custom build class)
and added this to the session using as session variable like session
For all other pages I have added a small test in the page_load event,
basically testing if the session != null, but also checking if the...
|
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 creation of content which adjusts based
on the user.
I have several pages which require a user to be logged on and several which
do not. Prior to this point in time I have used 2 different master pages.
one with a control which checks a session...
|
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:
<location path="admin">
<system.web>
<customErrors mode="Off"/>
<authentication mode="Forms">
<forms name=".COOKIEDEMO" loginUrl="login.aspx"
protection="All" timeout="60" path="/">
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |