trouble w/ Forms Auth and domain cookies

J

jeffpriz

I'm having trouble with a domain cookie and forms authentication.
We have several sub-domains so we create a domain cookie for forms
authentication purposes:

cook.domain = ".mydomain.com"

All is good with the world.. I can go all over the place and get in to
my apps... Great .. except now I can not Log Out...
I do:
Web.Security.FormsAuthentication.SignOut()
Me.Session.Abandon()

and what happens when I try to come back to my app? I get in just fine,
never sent back to my login page.

A little closer inspection using Firefox to watch my cookies, I see
that I end up with two cookies. One, is my domain cookie, but i also
end up with a "serversubdomain.mydomain.com" cookie... When I do my
FormsAuthentication.SignOut() my serverdomain cookie goes away, my
domain cookie does not.. so I am reauthenticated when I attempt to
re-enter the site..

Please help!

jeffpriz
 
D

Dominick Baier [DevelopMentor]

Hello (e-mail address removed),

can't you manually remove the cookie from the cookies collection with .Remove()
??
 
J

jeffpriz

Well I've tried a few things. I have tried the Remove, but that's not
met with any success (when I do my
context.Reesponse.Cookies.Remove("cookieName"), I assume I'm removing
one cookie, but I don't get access to BOTH cookies, I'm accessing by
name, I have 2 duplicately named cookies...)

Also I've tried expiring the cooking by writing out the same domain
cookie with an old expiration time.. but I haven't actually been able
to get it expired. It continues to authenticate against it.

thanks

jeffpriz
 
D

Dominick Baier [DevelopMentor]

Hello (e-mail address removed),

haven't tried that - but can you cycle through the whole cookie collection
and just remove everything

foreach (HttpCookie in Response.Cookies)
....
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top