createPersistentCookie not working in FormsAuthentication.RedirectFromLoginPage

I

Imran Aziz

Hello All,
I cannot seem to get createPersistentCookie option of
FormsAuthentication.RedirectFromLoginPage work. Even if I set it to true the
cookie is setup to expire after 30 min ( default settings )

Can you please suggest as to what can be done to sort this one out.

My code is as under

web.config

<authentication mode="Forms" >

<forms name="mysession"

loginUrl="login.aspx"

protection="All"

slidingExpiration="true"

path="/"

/>

</authentication>

<authorization>

<deny users="?" />

</authorization>



And then in the login page I have this code





if (objSec.AuthenticateUser(txtUserName.Text, txtPassword.Text))

{

FormsAuthentication.RedirectFromLoginPage(txtUserName.Text,true);

}

else

{

lblResults.Text = "Invalid Credentials: Please try again";

}



Can anyone please help to sort this one out.



Thanks a lot,



Imran.
 

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,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top