mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -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);
|
||
|
}
|