Re: Log out function in ASP.NET?

From: Christopher Nash (chrisnash99NOSPAM@hotmail.com)
Date: 01/28/03


From: "Christopher Nash" <chrisnash99NOSPAM@hotmail.com>
Date: Tue, 28 Jan 2003 12:29:10 -0500


Hello Eric,
I have struggled with the same issues. I ended up solving the problem using
some javascript to close the browser. You can't force the user to close the
browser, so I do it like this. First the Logout button sends the user to a
"logout" aspnet page. In the page_load method I put the following code.

Session.Clear();
Label1.Text = "Choose 'Yes' to log out and close the window. Choose 'No' to
remain logged in.";
this.RegisterStartupScript("logout",
    "<SCRIPT
LANGUAGE='JAVASCRIPT'>top.close();document.location.href='Welcome.aspx';</SC
RIPT>");

If the user chooses "Yes" the wiindow closes and they are logged out. If
they choose "No" they are sent to the initial screen of the application, and
they remain logged in. I have only tested this in I.E. 6.0.

Now, I'm trying to figure out how to log a user out when they access from
Pocket I.E. "top.close()" doesn't work in Pocket I.E. Does anyone have any
suggestions?

--Christopher Nash

"Eric C. Au" <auching@auburn.edu> wrote in message
news:#4sMqohxCHA.1268@TK2MSFTNGP10...
> Nicole,
>
> Thank you for the info. But my question is not about session. The problem
> is that IE caches windows domain login information. And I can't find any
> way to erase that except force people to close the browser or send out 403
> in the header (which sometimes confuse people because they suddenly see
the
> popup dialog for enter ID/password again)
>
>
> "Nicole Calinoiu" <nicolec@somewhere.net> wrote in
> news:eBL5nVMxCHA.2868@TK2MSFTNGP12:
>
> > "Logging out" in a web app usually means ending the user's server-side
> > session. To implement this from the client, either use a button that
> > runs the following server-side when clicked or a link to a page that
> > runs the same code from it's load event:
> >
> >
> > "Eric C. Au" <auching@auburn.edu> wrote in message
> > news:O$17nZ$wCHA.2904@TK2MSFTNGP09...
> >> I'm writing some internal application and use Windows authentication
> >> to perform the login process.
> >>
> >> Can someone tell me how to make a "log out" action and direct the
> >> user to another page?
> >>
> >> Currently, after the user logged in, the login information is kept
> >> there till he/she close that browser. And it's hard to force everyone
> >> to close browser after use the program.
> >
> >
> >
>


Quantcast