Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have cookie expiry changes reflected in UI #98

Draft
wants to merge 1 commit into
base: glitch
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,12 @@ fastify.post("/internal/StartSession", function (request, reply) {

// Set all cookies for the session.
sessionInfo.cookies.forEach(cookie => {
cookie.expires = new Date(Date.now() + cookie.maxAgeInSec * 1000);
reply.setCookie(cookie.name, to_json(cookie.value), {
domain: cookie.domain,
path: cookie.path,
maxAge: cookie.maxAgeInSec,
expires: new Date(Date.now() + cookie.maxAgeInSec * 1000),
expires: cookie.expires,
secure: cookie.secure,
sameSite: true,
});
Expand Down Expand Up @@ -332,11 +333,12 @@ fastify.post("/internal/RefreshSession", function (request, reply) {

// Refresh all cookies for the session.
g_sessions[session_id].cookies.forEach(cookie => {
cookie.expires = new Date(Date.now() + cookie.maxAgeInSec * 1000);
reply.setCookie(cookie.name, to_json(cookie.value), {
domain: cookie.domain,
path: cookie.path,
maxAge: cookie.maxAgeInSec,
expires: new Date(Date.now() + cookie.maxAgeInSec * 1000),
expires: cookie.expires,
secure: cookie.secure,
sameSite: true,
});
Expand Down