1// Set a same-site cookie for first-party contexts
2response.cookie('cookie1', 'value1', { sameSite: 'lax' });
3// Set a cross-site cookie for third-party contexts
4response.cookie('cookie2', 'value2', { sameSite: 'none', secure: true });
1response.setHeader('set-cookie', [
2 'cookie1=value1; SameSite=Lax',
3 'cookie2=value2; SameSite=None; Secure',
4]);