mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
14 lines
315 B
TypeScript
14 lines
315 B
TypeScript
export function getSessionExpiry() {
|
|
const expiryCookie = document.cookie.split('; ').find((row) => row.startsWith('grafana_session_expiry='));
|
|
if (!expiryCookie) {
|
|
return 0;
|
|
}
|
|
|
|
let expiresStr = expiryCookie.split('=').at(1);
|
|
if (!expiresStr) {
|
|
return 0;
|
|
}
|
|
|
|
return parseInt(expiresStr, 10);
|
|
}
|