Edit

Share via


CookiesSessionOnlyForUrls

Limit cookies from specific websites to the current session

Supported versions

  • On Windows and macOS since 77 or later

Description

Cookies created by websites that match a URL pattern you define are deleted when the session ends (when the window closes).

Cookies created by websites that don't match the pattern are controlled by the DefaultCookiesSetting policy (if set) or by the user's personal configuration. This is also the default behavior if you don't configure this policy.

You can also use the CookiesAllowedForUrls and CookiesBlockedForUrls policies to control which websites can create cookies.

Note there cannot be conflicting URL patterns set between these three policies:

For detailed information on valid url patterns, please see https://go.microsoft.com/fwlink/?linkid=2095322. * is not an accepted value for this policy.

If you set the RestoreOnStartup policy to restore URLs from previous sessions, this policy is ignored, and cookies are stored permanently for those sites.

Supported features

  • Can be mandatory: Yes
  • Can be recommended: No
  • Dynamic Policy Refresh: Yes
  • Per Profile: Yes
  • Applies to a profile that is signed in with a Microsoft account: Yes

Data type

  • List of strings

Windows information and settings

Group Policy (ADMX) info

  • GP unique name: CookiesSessionOnlyForUrls
  • GP name: Limit cookies from specific websites to the current session
  • GP path (Mandatory): Administrative Templates/Microsoft Edge/Content settings
  • GP path (Recommended): N/A
  • GP ADMX file name: MSEdge.admx

Example value

https://www.contoso.com
[*.]contoso.edu

Registry settings

  • Path (Mandatory): SOFTWARE\Policies\Microsoft\Edge\CookiesSessionOnlyForUrls
  • Path (Recommended): N/A
  • Value name: 1, 2, 3, ...
  • Value type: List of REG_SZ

Example registry value

SOFTWARE\Policies\Microsoft\Edge\CookiesSessionOnlyForUrls\1 =

https://www.contoso.com

SOFTWARE\Policies\Microsoft\Edge\CookiesSessionOnlyForUrls\2 =

[*.]contoso.edu

Mac information and settings

  • Preference Key name: CookiesSessionOnlyForUrls
  • Example value:
<array>
  <string>https://www.contoso.com</string>
  <string>[*.]contoso.edu</string>
</array>

See also