KStats/Public/tests/cookies.html

34 lines
1.1 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title data-i18n="contact_book_title">ContactBook</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<script data-type="text/javascript" data-language="ECMAScript 2015" charset="utf-8">
let session = null;
console.log(document.cookie);
!decodeURIComponent(document.cookie).split(";").some(cookie => {
const matches = cookie.trim().match(/^session_id_test\=(.*)$/);
if(matches){
session = Number(matches[1]);
return true;
};
}) &&
(document.cookie = "session_id_test=" + (session = Math.random() * 999999 >> 0) + ";expires=" + new Date(Date.now() + 60000).toUTCString() + ";path=/");
console.log(session);
</script>
</head>
<body></body>
</html>