Configure cookies: registry value DefaultCookiesSetting (Edge)UserHKCU\Software\Policies\Microsoft\Edge

Policy ID
DefaultCookiesSetting
Scope
Computer Configuration, User Configuration
Supported on
Microsoft Edge version 77, Windows 7 or later
Source
Microsoft Edge Policy Templates (version 155.0.4283.45)
Category
Microsoft Edge › Content settings

Registry

DefaultCookiesSetting

REG_DWORDUserComputer
Enabled value
Depends on the option value
Element
Configure cookies
Options
ItemStored value
Let all sites create cookies1
Don't let any site create cookies2
Keep cookies for the duration of the session, except ones listed in "SaveCookiesOnExit"4
Apply with .reg · CMD · PowerShell
UserPer-account setting
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Edge]

; Options (use only one)
; Let all sites create cookies
"DefaultCookiesSetting"=dword:00000001
; Don't let any site create cookies
"DefaultCookiesSetting"=dword:00000002
; Keep cookies for the duration of the session, except ones listed in "SaveCookiesOnExit"
"DefaultCookiesSetting"=dword:00000004
CMD
:: Options (use only one)

:: Let all sites create cookies
reg add "HKCU\Software\Policies\Microsoft\Edge" /v "DefaultCookiesSetting" /t REG_DWORD /d 1 /f
:: Don't let any site create cookies
reg add "HKCU\Software\Policies\Microsoft\Edge" /v "DefaultCookiesSetting" /t REG_DWORD /d 2 /f
:: Keep cookies for the duration of the session, except ones listed in "SaveCookiesOnExit"
reg add "HKCU\Software\Policies\Microsoft\Edge" /v "DefaultCookiesSetting" /t REG_DWORD /d 4 /f
PowerShell
# Common: create the key
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Edge' -Force | Out-Null

# Options (use only one)
# Let all sites create cookies
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Edge' -Name 'DefaultCookiesSetting' -PropertyType DWord -Value 1 -Force | Out-Null
# Don't let any site create cookies
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Edge' -Name 'DefaultCookiesSetting' -PropertyType DWord -Value 2 -Force | Out-Null
# Keep cookies for the duration of the session, except ones listed in "SaveCookiesOnExit"
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Edge' -Name 'DefaultCookiesSetting' -PropertyType DWord -Value 4 -Force | Out-Null
ComputerMachine-wide setting
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Edge]

; Options (use only one)
; Let all sites create cookies
"DefaultCookiesSetting"=dword:00000001
; Don't let any site create cookies
"DefaultCookiesSetting"=dword:00000002
; Keep cookies for the duration of the session, except ones listed in "SaveCookiesOnExit"
"DefaultCookiesSetting"=dword:00000004
CMD
:: Options (use only one)

:: Let all sites create cookies
reg add "HKLM\Software\Policies\Microsoft\Edge" /v "DefaultCookiesSetting" /t REG_DWORD /d 1 /f
:: Don't let any site create cookies
reg add "HKLM\Software\Policies\Microsoft\Edge" /v "DefaultCookiesSetting" /t REG_DWORD /d 2 /f
:: Keep cookies for the duration of the session, except ones listed in "SaveCookiesOnExit"
reg add "HKLM\Software\Policies\Microsoft\Edge" /v "DefaultCookiesSetting" /t REG_DWORD /d 4 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Edge' -Force | Out-Null

# Options (use only one)
# Let all sites create cookies
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Edge' -Name 'DefaultCookiesSetting' -PropertyType DWord -Value 1 -Force | Out-Null
# Don't let any site create cookies
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Edge' -Name 'DefaultCookiesSetting' -PropertyType DWord -Value 2 -Force | Out-Null
# Keep cookies for the duration of the session, except ones listed in "SaveCookiesOnExit"
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Edge' -Name 'DefaultCookiesSetting' -PropertyType DWord -Value 4 -Force | Out-Null