HOW TO CREATE REMEMBER ME CHECKBOX TO REMEMBER SESSION UNTIL USER LOGOUT EXPLICITLY

john rob

Total Post:108

Points:756
Posted by  john rob
VB.Net 
 1213  View(s)
Ratings:
Rate this:

If user directly close their browser without clicking logout then next time they open browser its session will be maintained as it is till they logout explicitly by clicking Logout button

I want to do it in vb.net !

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: How to create remember me checkbox to remember session until user Logout explicitly

    Hi John, 


    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>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!