开发者

How to create remember me checkbox to remember session until user Logout explicitly

开发者 https://www.devze.com 2023-02-06 13:36 出处:网络
If user directly close their browser without clicking logout then next time they open browser it开发者_如何学Cs session will be maintained as it is till they logout explicitly by clicking Logout butto

If user directly close their browser without clicking logout then next time they open browser it开发者_如何学Cs session will be maintained as it is till they logout explicitly by clicking Logout button

I want to do it in vb.net !


Simply pass true as second parameter when emitting the authentication cookie:

FormsAuthentication.RedirectFromLoginPage(Username, true)

This will create a persistent authentication cookie on the client whose expiration is handled by the timeout property in your web.config:

<forms 
   loginUrl="~/login.aspx" 
   defaultUrl="~/default.aspx"
   protection="All"
   timeout="3600"
</forms>


Use cookies.

0

精彩评论

暂无评论...
验证码 换一张
取 消