1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-29 22:56:37 -04:00

self.js: delete invalid cookie before redirecting

This commit is contained in:
Adhityaa Chandrasekar
2018-08-08 11:30:59 +05:30
parent c71d634e82
commit 12d9d52555
2 changed files with 12 additions and 0 deletions

View File

@ -75,6 +75,12 @@
}
// Deletes a cookie.
global.cookieDelete = function(name) {
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
// Converts a date in the past to a human-friendly duration relative to now.
global.timeSince = function(date) {
var seconds = Math.floor((new Date() - date) / 1000);