Skip to content

Instantly share code, notes, and snippets.

@MuttakinHasib
Created April 2, 2022 04:57
Show Gist options
  • Save MuttakinHasib/996ce8541a2e8f0516c90403619b346b to your computer and use it in GitHub Desktop.
Save MuttakinHasib/996ce8541a2e8f0516c90403619b346b to your computer and use it in GitHub Desktop.
Cookie Not Saving in Browser
res.cookie("accessToken", newAccessToken, {
maxAge: 8.64e7, // 24 hours
httpOnly: true,
secure: isProduction,
sameSite: isProduction ? "none" : "lax",
});
location /v2 {
rewrite ^/v2(.*) $1 break;
proxy_pass http://127.0.0.1:1337;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment