Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.ASPXAUTH cookie expires at session end

I use common auth infrastructure of asp.net with auth controls (login, logout, ...)

My config:

<authentication mode="Forms">
   <forms loginUrl="~/Administrators/Login.aspx" timeout="500000" />
</authentication>

I hope see that .ASPXAUTH cookie would expires at next year and i shouldn't enter login\passw again and again

But I see that this cookie always expires at the end of the session. How can I change this behaviour?

EDIT

sure I use checkox "Remember me". I think asp.net should create persistant cookie

like image 621
Andrew Kalashnikov Avatar asked Oct 03 '12 13:10

Andrew Kalashnikov


1 Answers

If you want to create persistent cookies, use:

FormsAuthentication.SetAuthCookie Method

FormsAuthentication.SetAuthCookie(userName, createPersistentCookie)

createPersistentCookie: true to create a persistent cookie (one that is saved across browser sessions); otherwise, false.

like image 86
Kapil Khandelwal Avatar answered Sep 28 '22 05:09

Kapil Khandelwal