Skip to content

Commit 423590f

Browse files
Merge branch 'main' into adding-sentry
2 parents 820301f + 1286d98 commit 423590f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

server/encrypted-session.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export const ENCRYPTED_COOKIE_REQUEST_DECORATOR = 'encryptedSessionInternal';
1313
export const UNDERLYING_SESSION_NAME_REQUEST_DECORATOR = 'underlyingSessionNotPerUserEncrypted';
1414

1515
// name of the secure-session cookie that stores the encryption key on user side.
16-
export const ENCRYPTION_KEY_COOKIE_NAME = 'session_encryption_key';
16+
export const ENCRYPTION_KEY_COOKIE_NAME = 'session-encryption-key';
1717
// the key used to store the encryption key in the secure-session cookie on user side.
1818
export const ENCRYPTED_COOKIE_KEY_ENCRYPTION_KEY = 'encryptionKey';
1919
// name of the cookie that stores the session identifier on user side.
20-
export const SESSION_COOKIE_NAME = 'session-cookie';
20+
export const SESSION_COOKIE_NAME = 'session';
2121

2222
async function encryptedSession(fastify) {
2323
const { COOKIE_SECRET, SESSION_SECRET } = fastify.config;
@@ -31,7 +31,7 @@ async function encryptedSession(fastify) {
3131
cookie: {
3232
path: '/',
3333
httpOnly: true,
34-
sameSite: "None", // cross-site cookies are needed for the session to work when embedded. By setting CORS to None and CSP.frame-anchestors we restrict the api calls from the browser that contain the cookies to originating from our site only.
34+
sameSite: 'None', // cross-site cookies are needed for the session to work when embedded. By setting CORS to None and CSP.frame-anchestors we restrict the api calls from the browser that contain the cookies to originating from our site only.
3535
partitioned: true, // use for modern isolation of third party cookies when embedded, every embedded iframe (or not embedded) gets its own cookie partition
3636
secure: true,
3737
maxAge: 60 * 60 * 24 * 7, // 7 days
@@ -44,7 +44,7 @@ async function encryptedSession(fastify) {
4444
cookie: {
4545
path: '/',
4646
httpOnly: true,
47-
sameSite: "None", // see secureSession cookie for explanation
47+
sameSite: 'None', // see secureSession cookie for explanation
4848
partitioned: true, // see secureSession cookie for explanation
4949
secure: true,
5050
maxAge: 60 * 60 * 24 * 7, // 7 days
@@ -112,14 +112,11 @@ function createStore(request) {
112112
},
113113
async delete(key) {
114114
delete unencryptedStore[key];
115-
await save()
116-
},
117-
print() {
118-
console.log("printing", unencryptedStore)
115+
await save();
119116
},
120117
async clear() {
121118
unencryptedStore = {}; // Clear all data
122-
await save()
119+
await save();
123120
},
124121
};
125122
}

0 commit comments

Comments
 (0)