Skip to content

Session: obsolete APIs removed in 3.0 #14844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rynowak opened this issue Sep 30, 2019 · 0 comments · Fixed by #15044
Closed

Session: obsolete APIs removed in 3.0 #14844

rynowak opened this issue Sep 30, 2019 · 0 comments · Fixed by #15044
Assignees
Labels
breaking-change Indicates a .NET Core breaking change

Comments

@rynowak
Copy link
Member

rynowak commented Sep 30, 2019

Session: obsolete APIs removed in 3.0

This change removes APIs for configuring session cookies that were marked obsolete as part of aspnet/Announcements#257

Version introduced

3.0

Old behavior

Obsolete APIs were present in the runtime.

New behavior

Obsolete APIs were removed.

Reason for change

This change makes our APIs for configuring features that use cookies consistent across ASP.NET Core.

Recommended action

Migrate usage of the removed APIs to their newer replacements

public void ConfigureServices(ServiceCollection services)
{
    services.AddSession(options =>
    {
        // Removed obsolete APIs
        options.CookieName = "SessionCookie";
        options.CookieDomain = "contoso.com";
        options.CookiePath = "/";
        options.CookieHttpOnly = true;
        options.CookieSecure = CookieSecurePolicy.Always;

        // new API
        options.Cookie.Name = "SessionCookie";
        options.Cookie.Domain = "contoso.com";
        options.Cookie.Path = "/";
        options.Cookie.HttpOnly = true;
        options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
    });
}

Category

ASP.NET Core

Affected APIs

SessionOptions.CookieName
SessionOptions.CookieDomain
SessionOptions.CookiePath
SessionOptions.CookieHttpOnly
SessionOptions.CookieSecure


Issue metadata

  • Issue type: breaking-change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants