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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top