Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Add CookieBuilder property to SessionOptions and obsolete duplicated properties #173

Merged
merged 1 commit into from
Jun 30, 2017

Conversation

natemcmaster
Copy link
Contributor

Addresses aspnet/HttpAbstractions#853.

Uses the new CookieBuilder API added here: aspnet/HttpAbstractions#882.

cc @HaoK @blowdart

public override string Name
{
get => base.Name;
set => base.Name = !string.IsNullOrEmpty(value)
Copy link
Member

@Tratcher Tratcher Jun 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving this check to the base class, there's no reason for the cookie name to ever be null/empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -105,8 +105,11 @@ public class SessionTests
{
app.UseSession(new SessionOptions
Copy link
Member

@HaoK HaoK Jun 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but this is pretty gross, given that Session is using IOptions<SessionOptions> we should really kill this pattern.

If we want to avoid making them go Configure<SessionOptions>(o => ), we can change UseSession(o => o.Cookie.Name = "TestCookie"), this new SessionOptions/Wrapper pattern stuff needs to burn....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tratcher @davidfowl @ajcvickers @divega thoughts? Can we get rid of all instances where we UseXyz(new XyzOptions()) and consistently always use UseXyz(o => )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming UseXyz is using IOptions...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth considering, but not as part of this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just meant a cleanup pass for all middleware doing this, not something for this PR, I'll file an issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


public override TimeSpan? Expiration
{
get => default(TimeSpan);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return null.

@natemcmaster natemcmaster force-pushed the namc/cookie-builder branch from 931aee7 to dece939 Compare June 30, 2017 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants