dotnet / dotnet/AspNetCore.Docs

Checking for expired ClaimsPrincipal cookie

Open
#17,307 0 comments 2 reactions 0 assignees View on GitHub
Security-PU Source - Docs.ms
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

In the "About cookie expiration" section, the following explains how to set an expiration time. Could something be added on how to check if a ClaimsPrincipal cookie is expired? I can't find this information anywhere in the docs.

> An absolute expiration time can be set with ExpiresUtc. To create a persistent cookie, IsPersistent must also be set. Otherwise, the cookie is created with a session-based lifetime and could expire either before or after the authentication ticket that it holds.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: d2229fc6-f8c8-952e-e567-b1d5a463055a
* Version Independent ID: b18a015b-914d-f014-f711-120d208904d9
* Content: [Use cookie authentication without ASP.NET Core Identity](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/cookie?view=aspnetcore-3.1)
* Content Source: [aspnetcore/security/authentication/cookie.md](https://github.com/dotnet/AspNetCore.Docs/blob/master/aspnetcore/security/authentication/cookie.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-security**
* GitHub Login: @Rick-Anderson
* Microsoft Alias: **riande**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.