Update CookieAuthenticationOptions XML documentation to clarify ExpireTimeSpan usage#64122
Merged
MackinnonBuck merged 5 commits intomainfrom Oct 23, 2025
Merged
Conversation
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update comments for CookieAuthenticationOptions
Update CookieAuthenticationOptions XML documentation to clarify ExpireTimeSpan usage
Oct 20, 2025
3 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR corrects misleading XML documentation for the ExpireTimeSpan property in CookieAuthenticationOptions. The original documentation incorrectly implied that CookieOptions.Expires could be used separately to control browser cookie lifetime, when in fact attempting to set it throws a validation exception.
Key Changes:
- Updated XML documentation to clarify that
ExpireTimeSpanshould be used instead ofCookieOptions.Expires, not in addition to it - Removed misleading language that suggested
CookieOptions.Expirescould be used to separately control browser cookie lifetime - Aligned documentation with actual implementation behavior where the handler overrides cookie expiration based on
ExpireTimeSpan
MackinnonBuck
approved these changes
Oct 21, 2025
…documentation Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
BrennanConroy
approved these changes
Oct 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation Fix: Update CookieAuthenticationOptions XML Comments
Plan
ExpireTimeSpanproperty incorrectly suggests usingCookieOptions.Expiresas a separate control, but this property is actually ignored/validated againstExpireTimeSpanpropertyCookieBuilder.Expirationinstead ofCookieOptions.Expiresfor consistency ✓Changes Summary
Updated the XML documentation comment for the
ExpireTimeSpanproperty inCookieAuthenticationOptions.csto correctly reflect the implementation.Final change:
CookieOptions.ExpirestoCookieBuilder.Expirationto be consistent with:CookieBuilder.ExpirationDocumentation now states:
/// This property should be used instead of <see cref="CookieBuilder.Expiration"/>, which is ignored.This ensures consistency throughout the codebase and aligns with how developers actually interact with the API (via
Cookie.ExpirationwhereCookieis of typeCookieBuilder).Original prompt
Fixes #64074
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.