Update app-state.md (#4598)

pull/4622/head
Rick Anderson 2017-10-23 14:57:34 -10:00 committed by GitHub
parent 5b6f706d25
commit 0dc03fe063
1 changed files with 12 additions and 1 deletions

View File

@ -54,6 +54,7 @@ In ASP.NET Core 1.0 and 1.1, the session state TempData provider is the default.
--------------
<a name="choose-temp"></a>
### Choosing a TempData provider
Choosing a TempData provider involves several considerations, such as:
@ -65,7 +66,17 @@ Choosing a TempData provider involves several considerations, such as:
> [!NOTE]
> Most web clients (such as web browsers) enforce limits on the maximum size of each cookie, the total number of cookies, or both. Therefore, when using the cookie TempData provider, verify the app won't exceed these limits. Consider the total size of the data, accounting for the overheads of encryption and chunking.
To configure the TempData provider for an application, register a TempData provider implementation in `ConfigureServices`:
<a name="config-temp"></a>
### Configure the TempData provider
# [ASP.NET Core 2.x](#tab/aspnetcore2x)
In ASP.NET Core 2.0 and later, the cookie-based TempData provider is enabled by default. Use the following code to change the TempData provider.
# [ASP.NET Core 1.x](#tab/aspnetcore1x)
To configure the TempData provider, register a TempData provider implementation in `ConfigureServices`:
------
```csharp
public void ConfigureServices(IServiceCollection services)