Write the user's Session / Cookie when signing in

1

In WEB applications, usually in the Login screen you have the Remind me option, this application will save the user data once it has checked the option.

So when the user re-enters the site, instead of going to the Login screen, he will go directly to the application's home screen, not having to log in again.

Reading some forums I saw something related to Cookies and Session of the user. But it was not clear to me how this process is done.

  

1 - Get the user Session means what?

     

2 - Does the implementation of Cookies mean what?

     

3 - The 2 cases interact to validate / record user access, not   needing to perform a new access?

    
asked by anonymous 31.01.2018 / 11:54

1 answer

1

1 - Session means you store data during user activity on your site, and will expire when it leaves or after a certain downtime. This information is available anywhere in the backend application.

In the case of ASP.Net MVC with IIS, the most common mode of Session is InProc which causes this data to be stored in server memory.

In ASP.NET Core, the session is created using cookies to hold this information.

2 - Cookies are information stored in the browser, where they can be accessed in both the backend and the frontend, depending on the configuration. This information is passed on all requests because HTTP is a protocol that does not maintain state and also has an expiration date.

3 - In your case, to keep the user logged in, the best option is to use cookies. You can create a cookie by identifying the user, determining the validity, and the next time he accesses your site through the same browser, you identify the cookie and perform the necessary treatments to authenticate the user again.

As a suggestion, you can take a look here, that talks more about authentication with cookies

    
31.01.2018 / 13:52