Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Oct 5, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Logging off a Web site

I have a Web site that forces a login with NT security. (Thus the person has to have an NT account to login.) I want to include a logoff button that logs users out of the account when they are finished. Do you know a way of doing this? As of yet the only way I have found is to close the browser.


You could use the Status property of the Response object to send out a 401 status code. That will throw up an authentication dialog box. You could also abandon any session variables at the same time. Here's how the code might look at the top of your ASP page:

if Request.Form("logout")="yes" then
Response.Status = "401 Unauthorized"
end if

Here's what you might put in the logoff form:

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date