Skip to content

Commit 2aeaa08

Browse files
authored
Merge pull request element-hq#9383 from vector-im/travis/expire-mobile-page
Add expiration to mobile guide cookie
2 parents 50b4906 + b72ae19 commit 2aeaa08

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/vector/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ async function loadApp() {
272272
const isIos = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
273273
const isAndroid = /Android/.test(navigator.userAgent);
274274
if (isIos || isAndroid) {
275-
if (!document.cookie.split(';').some((c) => c.startsWith('mobile_redirect_to_guide'))) {
275+
if (document.cookie.indexOf("riot_mobile_redirect_to_guide=false") === -1) {
276276
window.location = "mobile_guide/";
277277
return;
278278
}

src/vector/mobile_guide/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {getVectorConfig} from '../getconfig';
22

33
function onBackToRiotClick() {
4-
document.cookie = 'mobile_redirect_to_guide=false;path=/';
4+
// Cookie should expire in 4 hours
5+
document.cookie = 'riot_mobile_redirect_to_guide=false;path=/;max-age=14400';
56
window.location.href = '../';
67
}
78

0 commit comments

Comments
 (0)