Please enable JavaScript.
Coggle requires JavaScript to display documents.
State Management - Coggle Diagram
State Management
Sessions
Sessions are a mechanism for storing and managing user-specific data on the server side across multiple HTTP requests for a given session
A session provides a way to maintain a state for a user throughout their interaction with a web application, allowing you to store and retrieve data that is associated with a particular user’s session.
Sessions are particularly useful when you need to store data that should be available across different pages or requests for a specific user without relying on cookies or query parameters. cookies, which are stored on the client-side, session data is stored on the server side
web applications operate on the stateless HTTP Protocol, where each HTTP request is independent. The web server is unable to store anything on the server related to the client’s request
How does Session Works
-
Configured Session
//Configuring Session Services in ASP.NET Core
builder.Services.AddDistributedMemoryCache(); builder.Services.AddSession(options =>{});
-
-
-
Cookies
A cookie is a small text file that a website stores on a user’s computer or mobile device when they visit the site. This file contains information that can be used to identify the user, such as their login status or preferences, and is sent back to the website with every subsequent request. Typically, it’s used to tell the web server if two requests are coming from the same web browser.
Cookies have size limitations (usually around 4KB), which may restrict the amount of data you can store in them.
Cookies are stored on the client side. Since storing in client side. There is a chance of can be tampered
The Web communication between a server and a client uses the HTTP protocol, which is a stateless protocol.