Newbee question: How to kill a cookie?

V

Valmir

Great! Thanks a lot.

--



---------------
Valmir


Raterus said:
Tried this?

FormsAuthentication.SignOut()

xiko tripa said:
Hi,

I've implemented the forms authentication just like the following msdn
article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT02.asp
(watch out for the line wrap)

Everything is working fine. Once the user is authenticated, he/she can
navigate out to the secure portion of the site and navigate back while
the ticket hasn't expired.

But the world isn't perfect and I was asked to implement a logoff
option. So I think I need to 'kill' the ticket. I've tryied a lot of
things with no success. For example (cookieName is a var containing
the cookie name generated by the FormsAuthenticationTicket object):

Context.Request.Cookies[cookieName].Expires = DateTime.Now;
or
Context.Response.Cookies[cookieName].Value = null;
or
Response.Cookies[CookieName].Expires = DateTime.Now;
or
Response.Cookies[CookieName].Value = "";
or
Response.Cookies.Remove(CookieName);

None of above expired the ticket, disabling the user to navigate back
to the site's secure area.

Any idea?

TIA

Valmir
 
X

xiko tripa

Hi,

I've implemented the forms authentication just like the following msdn
article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT02.asp
(watch out for the line wrap)

Everything is working fine. Once the user is authenticated, he/she can
navigate out to the secure portion of the site and navigate back while
the ticket hasn't expired.

But the world isn't perfect and I was asked to implement a logoff
option. So I think I need to 'kill' the ticket. I've tryied a lot of
things with no success. For example (cookieName is a var containing
the cookie name generated by the FormsAuthenticationTicket object):

Context.Request.Cookies[cookieName].Expires = DateTime.Now;
or
Context.Response.Cookies[cookieName].Value = null;
or
Response.Cookies[CookieName].Expires = DateTime.Now;
or
Response.Cookies[CookieName].Value = "";
or
Response.Cookies.Remove(CookieName);

None of above expired the ticket, disabling the user to navigate back
to the site's secure area.

Any idea?

TIA

Valmir
 
X

xiko tripa

Raterus said:
Tried this?

FormsAuthentication.SignOut()

Sorry! It didn't work... The user's still able to navigate back to
secure area even after calling FormsAuthentication.SignOut() on the
logoff.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top