Forms Authentication and remember me (1.1 framework)

S

seal

I have successfully been using Forms Auth and remember me but I just found
that I was not using forms auth signout.

So for my login I was doing this ....
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
FormsIdentity id = HttpContext.Current.User.Identity as FormsIdentity;
}
When I add the forms auth signout, this no longer works with the remember me
cookie. MSDN says, "This removes either durable or session cookies." Am I
understanding this correctly, the forms auth cookie is removed? How then is
one supposed to store variables so that the user does not have to log in
every time? Another cookie.
 
D

Dominick Baier [DevelopMentor]

why do you need a signout if you have persistent cookies -

MSDN is right - the cookie gets removed. If you want to keep it - don't call
SignOut
 
S

seal

Thanks Dominick

I was reading up on another bug and I came accross a 'best practices' and
one of the things pointed out that you should always use the
formsauth.signout, and that surprised me. So I thought I would post to see if
I was missing something. Just wanted to make sure I was doing it properly.

Thanks
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top