Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 983 Bytes

File metadata and controls

27 lines (21 loc) · 983 Bytes

JavaScript example for SameSite=None; Secure

Calls to document.cookie continue to work as they have before. You can provide the SameSite attribute as part of the assigned string.

// Set a same-site cookie for first-party contexts
document.cookie = 'cookie1=value1; SameSite=Lax';
// Set a cross-site cookie for third-party contexts
document.cookie = 'cookie2=value2; SameSite=None; Secure';