Skip to content

Commit

Permalink
update session_id to always be set in cookie and localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
nattvara committed Apr 18, 2024
1 parent e163d39 commit 7afc19e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions gui/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ export function getSessionId() {
}

export function setSessionId(sessionId: string) {
try {
Cookies.set("session_id", sessionId, { expires: 365, secure: true, sameSite: "None" });
} catch (e) {
localStorage.setItem("session_id", sessionId);
}
Cookies.set("session_id", sessionId, { expires: 365, secure: true, sameSite: "None" });
localStorage.setItem("session_id", sessionId);
}

export class HttpError extends Error {
Expand Down

0 comments on commit 7afc19e

Please sign in to comment.