From d9554268b564504cf0ecab2fab25598e1f5bf5fe Mon Sep 17 00:00:00 2001 From: Egor Gorbachev <7gorbachevm@gmail.com> Date: Wed, 7 Aug 2024 10:14:16 +0700 Subject: [PATCH] Forbid 'session' as sessionName in StoreSession.ts (#704) --- gramjs/sessions/StoreSession.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gramjs/sessions/StoreSession.ts b/gramjs/sessions/StoreSession.ts index f032167d..4303ad2b 100644 --- a/gramjs/sessions/StoreSession.ts +++ b/gramjs/sessions/StoreSession.ts @@ -9,6 +9,9 @@ export class StoreSession extends MemorySession { constructor(sessionName: string, divider = ":") { super(); + if (sessionName === "session") { + throw new Error("Session name can't be 'session'. Please use a different name."); + } if (typeof localStorage === "undefined" || localStorage === null) { const LocalStorage = require("./localStorage").LocalStorage; this.store = store.area(