How to create Permanent User Login Session In ASP.NET?

How to add Permanent User Login Session In ASP.NET?

Solution of Permanent User Login Session In ASP.NET

I had to give Solution of How to Permanent User Login Session In ASP.NET.

Here I try to solved how to create a permanent user login session in ASP.NET.
Here..demo code includes an ASP.NET MVC4 project to control the user registration and login process.
If you want to use this process in any type of ASP.NET project So,you can use.

To follow By Below Code:

Forms Authentication

Before getting this article, you must be remember with forms authentication in ASP.NET.
The configuration of form authentication store in web.config file
which has the below configuration-file fragment with the assigned values.

<authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn"
             protection="All"
             timeout="1"
             name=".USERLOGINCONTROLAUTH"
             path="/"
             requireSSL="false"
             slidingExpiration="true"
             defaultUrl="~/Home/Index"
             cookieless="UseDeviceProfile"
             enableCrossAppRedirects="false"/></authentication>

Description of default value:

*loginUrl:-Contain your application’s custom logon page.When the requires Secure Sockets Layer (SSL)
You should place the logon page in a that folder.

*Protection is set to All to specify privacy and integrity for the forms authentication ticket.
This causes the authentication ticket to be encrypted using the algorithm specified on the machineKey element,
and to be signed using the hashing algorithm that is also specified on the machineKey element.
*timeout is used to specify a limited forms authentication session.

It’s Default value is 30 minutes. If a persistent forms authentication cookie is issued,
the timeout attribute is also used to set the lifetime of the persistent cookie.
*name and path are set to the values defined into application’s configuration file.
*requireSSL is set to false.
*slidingExpiration is set to true,a sliding session lifetime. This means that the session timeout is temporary
reset as long as a
user stays active on the site.
*defaultUrl is set to the Default.aspx page for the application.
*cookieless is set to UseDeviceProfile to specify that the application use cookies
for all browsers that support cookies.

*enableCrossAppRedirects is set to false to indicate that forms authentication does not support
automatic processing of tickets that are passed between applications on the query string or as part of a form POST.

About the Author

avatar