Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsChoose ASP.NET Core session storage according to your deployment topology. AddDistributedMemoryCache is suitable for development or a single process. Applications running on multiple instances should use a shared distributed cache such as Redis, SQL Server, or PostgreSQL. Session is server-side, cache-backed, and ephemeral: the browser holds only an encrypted session identifier, so critical or sensitive data belongs elsewhere.
How ASP.NET Core session storage works
Microsoft describes session as storage for user data while a person browses a web application. ASP.NET Core keeps the data in a cache and sends the browser a cookie containing a session ID. On later requests, the application uses that ID to retrieve the server-side record.
The session record is not a database of record. Your application should continue to work if it disappears because of cache eviction, expiration, a restart, or a deployment. Store authoritative data—orders, account information, permissions, and other business records—in your database. Session can cache a small, convenient representation of that data.
The session cookie is protected with ASP.NET Core Data Protection. Every application instance that needs to read the cookie must use compatible Data Protection configuration and shared key storage.
#1 Best Overall
- 【Powerful Load-bearing】12U Network Rack Open Frame is constructed from durable cold rolled steel; Rack shelf supports enhance stability, wall-mounted capacity of 130lbs, the ground-mounted up to 260lbs
- 【Considerate Designs】Open-frame layout, including a top panel adding space, anti-slip shelf stops fixing devices and compatible racks for stack and expansion to meet requirements of home server rack
- 【Complete Accessories】A 12U open frame server rack, two ventilated shelves, four shelf stops, four velcro straps and a set of equipment mounting screws
- 【Versatile Application】Ideal for space-efficient multi-device setups in warehouses, retail, classrooms, offices and more; Excellent choices as AV Rack/IT Rack
- 【Effortless Setup】 Network Rack includes hardware, a comprehensive manual, mounting hole drilling template and an online assembly video to simplify setup
Choose storage by deployment topology
| Provider | Best fit | Trade-offs |
|---|---|---|
Distributed in-memory cache (AddDistributedMemoryCache) |
Development, tests, or one app instance where loss on restart is acceptable | Data lives in one process’s memory. Separate instances cannot share it, and a process restart loses the contents. |
| Redis | Multiple app instances needing a shared cache and an organization prepared to operate Redis or a managed service | Provides shared access without sticky sessions, but adds hosting, availability, security, and operational responsibilities. |
| SQL Server distributed cache | Teams already operating SQL Server and its administration, backup, and monitoring ecosystem | Uses SQL Server as the cache provider. Sharing the same database with application data can reduce performance; the impact depends on the deployment and workload. |
| PostgreSQL distributed cache | Teams standardized on PostgreSQL that want the documented provider | A shared-cache option whose suitability depends on capacity, operations, and workload characteristics. |
Compare providers on whether requests can reach different instances, whether contents must survive restarts or deployments, existing operational expertise, added infrastructure, failure handling, and measured behavior under your workload. Microsoft does not publish a universal speed ranking for Redis, SQL Server, and PostgreSQL.
When local memory is enough
Use the in-memory provider for local development, automated tests, prototypes, or a deliberately single-instance application. It is not a shared distributed store. If a load balancer sends the next request to another instance, that instance cannot see the first instance’s session record.
Rank #2
- ADJUSTABLE DEPTH: 4-Post 42U open frame server rack with 4 vertical rails and adjustable mounting depth 22" to 40" (56,0cm to 101,7cm); Compatible with various servers / switches / data / AV and other IT equipment; EIA/ECA-310-E Compliant
- EASY ASSEMBLY: Mobile network rack with easy-to-follow assembly instructions and online video; Compact flat-pack shipping to avoid damage and facilitate installation; Total product height of 80.3in (204 cm) with casters, 78in (198cm) without casters
- COLD ROLLED STEEL: Durable 4 Post 19in open frame rack designed for ventilation with 42U mounting height and 1320lb (600kg) weight capacity (stationary); 3 install options included: casters, levelling feet, or base-plate to secure rack to the floor
- HARDWARE INCLUDED: Rolling computer/data rack includes cage nuts and screws to mount equipment, easy to read Units (U) and depth adjustment markings, cable management hooks for organization, and required assembly tools
- THE IT PRO'S CHOICE: Designed and built for IT Professionals, this 42U rack is backed for 2-years, including free lifetime 24/5 multi-lingual technical assistance
Why sticky sessions are not the usual solution
Session affinity can keep a browser on one server and make process-local storage appear to work. It reduces routing flexibility, can complicate deployments and failover, and can limit scalability. A shared Redis, SQL Server, or PostgreSQL cache lets any instance handle the request instead.
Minimal configuration
Session requires three pieces: an IDistributedCache implementation, AddSession in dependency injection, and UseSession in the request pipeline.
Rank #3
- Adjustable Depth: 23-40'' adjustable depth is used for servers and network equipment, ensuring enough space for AV equipment, components, and cabling, while allowing you to access ports and equipment from multiple sides.
- Strong Load Capacity: Ground-Mounted Load Capacity: 500 lbs, Wall-Mounted Load Capacity: 150 lbs. The av rack is made of carbon steel for better weldability performance and can help save space while meeting your need to place multiple devices.
- User-friendly Design: Ergonomic design makes the open frame av rack easier to use. The additional top panel is able to place other items with more available space. Roller design moves anywhere and anytime, is convenient, and is more energy-saving.
- Complete Accessories: We provide the accessories you need, including 2 x Pallets, 145 x M5*10 Cross Head Screws, 4 x Casters, 4 x M10*50 Expansion Screws,10 x M6*12 Cage Nuts, 1 x Grounding Wire, 1 x User Manual.
- Wide Application: The server rack wall mount maximizes the use of available space, suitable for retail venues, classrooms, offices, and other places where space is limited.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDistributedMemoryCache();
builder.Services.AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromMinutes(20);
options.Cookie.HttpOnly = true;
options.Cookie.IsEssential = true; // Use only when appropriate for consent policy.
});
var app = builder.Build();
app.UseRouting();
app.UseSession();
app.MapDefaultControllerRoute();
app.Run();
- Register the selected cache provider before building the application. For a multi-instance deployment, replace
AddDistributedMemoryCachewith the current official registration and connection configuration for your Redis, SQL Server, or PostgreSQL provider. - Call
AddSessionand set only the options your application needs. - Call
UseSessionafter routing and before endpoint execution or any component that readsHttpContext.Session. - Ensure all instances can reach the cache and share compatible Data Protection keys.
The default IdleTimeout is 20 minutes. It controls how long session contents may remain idle in the cache, not how long the cookie remains in a browser. Each request resets the idle timeout. Session cookies are not essential by default; marking one essential is a consent and privacy decision, not a universal legal recommendation.
Accessing session safely
The default provider loads the session record asynchronously only when application code explicitly calls ISession.LoadAsync before TryGetValue, Set, or Remove. Without that call, the provider uses a synchronous load path, which can cause avoidable blocking at scale.
Rank #4
- Universal 19” Rack Mount Compatibility – Perfect for pro audio, video, IT, and network gear. Compatible with mixers, routers, patch panels, servers, power amps, and more.
- Heavy-Duty Load Capacity – Built to support up to 550 lbs. Ideal for studio gear, DJ setups, server equipment, and AV components that demand serious stability.
- Robust Steel Frame & Design – Made with 1.5mm thick steel and weighs 36 lbs for maximum durability, reduced vibration, and long-term reliability in any setting.
- Mobile & Secure – Preinstalled with 3” industrial-grade caster wheels (lockable), making it easy to move and position your rack exactly where you need it.
- All-In-One Setup Kit Included – Comes with 34 rack screws (5mm & 6mm), a 1U blank spacer, and an assembly tool—ready for fast installation out of the box.
await HttpContext.Session.LoadAsync();
var value = HttpContext.Session.GetString("theme");
HttpContext.Session.SetString("theme", "dark");
await HttpContext.Session.CommitAsync();
Call CommitAsync when persistence must be verified. If the backing store is unavailable, LoadAsync throws. Commit failures are logged by the middleware, but a request may otherwise continue; explicitly awaiting the commit lets the application detect and handle the failure before claiming the update succeeded.
Concurrency and data-model limits
Session operations are non-locking. Two concurrent requests can read the same record and then overwrite one another; the later write wins. Session is stored as one coherent record, so a request changing key A can overwrite a concurrent request’s change to key B. The provider does not merge independent key updates.
Best Value
- Adjustable Depth: Depth adjustable from 23" to 40", this open frame server rack accommodates servers and network equipment while providing ample space for A/V gears and cable management. Enjoy easy access to ports and devices from multiple angles.
- High Weight Capacity: Supports up to 300 lbs on the floor (200 lbs when adjusted to maximum depth) and 200 lbs when wall-mounted (depth cannot be adjusted in wall-mounted mode). Made from carbon steel for superior welding performance and durability, this open frame rack is designed to save space while accommodating multiple devices.
- User-Friendly Design: Designed with your convenience in mind, this open frame server rack features an top shelf for extra storage and improved space utilization. The rolling casters let you move it effortlessly wherever you need it, making setup and movement a breeze.
- Widely Applicable: Maximize your space with this adaptable open frame server rack, designed to make the most of every inch. Ideal for retail spots, classrooms, offices, and any area where space is at a premium, it delivers practical solutions for your storage needs.
- Everything You Need: Our open-frame rack comes with fully equipped accessory kit for easy setup and secure installation: 2 x Trays, 4 x Casters, 1 x set of Screws, 16 x M6*12 Cage Nuts, 1 x Grounding Wire, 1 x Internal & External Hex Wrenches, and 1 x User Manual.
- Keep session values small and reconstructable.
- Do not use session as a transactional shopping cart or authoritative workflow state.
- Persist important changes in a database with appropriate transaction or concurrency controls.
- Design requests that update session concurrently so lost updates are harmless, or move that state to a store with explicit concurrency support.
Security, privacy, and Data Protection
Do not put passwords, access tokens, payment information, or other sensitive payloads in session. Encrypting the browser’s session-ID cookie does not make the server-side session a suitable secret store. A browser can preserve a session cookie across windows, and a session is not necessarily restricted to one human user.
In a server farm, configure persistent, shared Data Protection keys. Without compatible keys, one instance may be unable to decrypt a cookie created by another even when both use the same cache. Protect the key repository and restrict access according to your hosting environment.
Special cases and unsupported usage
Session and SignalR
ASP.NET Core session is not supported in SignalR applications because a hub can execute without an HTTP context. Use state mechanisms designed for the hub’s connection and execution model instead.
Response timing
A new session cookie cannot be created after response writing has started. Access or initialize session before headers are sent, particularly in streaming or custom middleware.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Quick Recap
Troubleshooting checklist
Unable to resolve service for type IDistributedCache: register one cache implementation before callingAddSession.HttpContext.Sessionis unavailable: verify thatUseSessionruns before the endpoint or middleware that accesses it.- Works on one server but not another: use a common distributed cache and compatible shared Data Protection keys.
- Updates vanish during simultaneous requests: account for non-locking, whole-record replacement; session does not merge keys.
- The request succeeds but data is missing later: await
CommitAsyncwhere persistence matters and handle the resulting exception. - Blocking appears under load: call
LoadAsyncbefore session reads and writes.
A practical decision sequence
- If the application is development-only or intentionally single-instance, start with distributed in-memory cache.
- If two or more instances can serve the same browser, select a shared provider rather than relying on affinity.
- Prefer the technology your team can monitor, secure, back up where appropriate, and operate reliably; do not choose from an assumed universal benchmark.
- Keep session ephemeral, non-sensitive, and small. Put durable business state in its proper database.
- Test restarts, failover, cache outages, concurrent requests, key rotation, and deployments before relying on the configuration.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

