Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Application Security Testing: An Integral Part of DevOps

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