G
Guest
Hi,
I have a login page where if the user wants his access codes to be saved are
set into a cookie. In the logout page, I want to delete those cookies. I
tried this and this is not working at all:
if (Request.Cookies[COOKIE_USER] != null
&& Request.Cookies[admin.COOKIE_PSWD] != null)
{
Response.Cookies[COOKIE_USER].Value = null;
Response.Cookies[COOKIE_PSWD].Value = null;
Response.Cookies.Remove(COOKIE_USER);
Response.Cookies.Remove(COOKIE_PSWD);
}
If I do a response.write like this right after or on another page, it shows
that the cookies are still set:
Response.Write((Request.Cookies[COOKIE_USER] == null) + " " +
Request.Cookies[COOKIE_USER].Value + " ");
Response.Write((Request.Cookies[COOKIE_PSWD] == null) + " " +
Request.Cookies[COOKIE_PSWD].Value);
Why is this not working? How do we remove user's cookie?
Thanks
Stephane
I have a login page where if the user wants his access codes to be saved are
set into a cookie. In the logout page, I want to delete those cookies. I
tried this and this is not working at all:
if (Request.Cookies[COOKIE_USER] != null
&& Request.Cookies[admin.COOKIE_PSWD] != null)
{
Response.Cookies[COOKIE_USER].Value = null;
Response.Cookies[COOKIE_PSWD].Value = null;
Response.Cookies.Remove(COOKIE_USER);
Response.Cookies.Remove(COOKIE_PSWD);
}
If I do a response.write like this right after or on another page, it shows
that the cookies are still set:
Response.Write((Request.Cookies[COOKIE_USER] == null) + " " +
Request.Cookies[COOKIE_USER].Value + " ");
Response.Write((Request.Cookies[COOKIE_PSWD] == null) + " " +
Request.Cookies[COOKIE_PSWD].Value);
Why is this not working? How do we remove user's cookie?
Thanks
Stephane