I have website that is authenticated using Active directory (no form authentication-simple password protected folder that prompts for credentials). Once the user enter his/her credentials, they have access to the password protected section. I need to have a logoff button that once the user click on it, the cookie that stores their credentials, gets modified or deleted, so if the user goes back to the link, the credentials are asked again. All this without closing the browser.
<% Response.Buffer = True Dim strCookieName Dim strCookieValue strCookieName = CStr(Request.QueryString("name")) strCookieValue = CStr(Request.QueryString("value")) If strCookieName <> "" Then If strCookieValue <> "" Then Response.Cookies(strCookieName) = strCookieValue Response.Cookies(strCookieName).Expires = Date() + 1 Else Response.Cookies(strCookieName) = "must be something!" Response.Cookies(strCookieName).Expires = Date() - 1 End If End If Response.Redirect("yourpage.asp") %>
on the code you sent do i need to change anything like the name of the cookie somewhere? other than the yourpage.asp let me show you how my file looks like <% Response.Buffer = True Dim strCookieName Dim strCookieValue strCookieName = CStr(Request.QueryString("name")) strCookieValue = CStr(Request.QueryString("value")) If strCookieName <> "" Then If strCookieValue <> "" Then Response.Cookies(strCookieName) = strCookieValue Response.Cookies(strCookieName).Expires = Date() + 1 Else Response.Cookies(strCookieName) = "must be something!" Response.Cookies(strCookieName).Expires = Date() - 1 End If End If Response.Redirect("index.html") %> <script> window.setTimeout("window.close()", 100); </script> is there anything else i need to change??????????????
I dont know if this is normal behavior, but i check on firefox to show the cookies. and the cookie yesterday was named this ASPSESSIONIDCSTBCBSR today is name this ASPSESSIONIDASTBDBTR i tried that code, but it does not do what i need. it keeps loging me withouth asking me for credentials
would it be possible for someone to paste the content of logon.aspx and defautl.aspx of a form authentication that is working. I am very new at this and dont know how to code on vb. if you have a system that works comparing to active directory that will be helpfull. I have used several code and i am guessing none of them work because i dont know what i a m doing. so if you have baby steps to follow i will appreaciate it. is just the form that i need to compare to my active directory, i think they should have the same functionality right?