views:

185

answers:

1

In my login page I'm using FormsAuthentication.RedirectFromLoginPage() to redirect to Home page after the user is validated. But it doesn't seem to obey CreatePersistenceCookie parameter. I have searched in Google and modified my Web.Config but still Remember Me functionality does not work.

this is my sample code structure (using asp.net login control as the login UI)

if (MyService.ValidateUser(LoginUser.UserName, LoginUser.Password))
{
   FormsAuthentication.RedirectFromLoginPage(LoginUser.UserName, LoginUser.RememberMeSet);
}

Web.Config

<forms loginUrl="~/Account/Login.aspx" timeout="21600" cookieless="AutoDetect" name="MySiteAuth" slidingExpiration="true"/>

Even when LoginUser.RememberMeSet is True (user has selected Remember Me checkbox) the browser doesn't remember the session. So when I open the web site next time I'm presented with the Login page. Ideally Login page should only come if have specifically Logged-out in the previous session. otherwise it should persist my session.

Does anyone have an explanation for this?

thanks

A: 

Check the link

"remember me" not working on login control

Login control [remember me] cookie non-persistent

Azhar
None of those seem to work. I referred to lot of articles like that. Seems like a popular issue. I decided to maintain my own cookie and it seems to work properly.
ravinsp