diff --git a/client/js/shout.js b/client/js/shout.js index 7e7cd66..0fc5f70 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -126,7 +126,12 @@ $(function() { } if (data.token) { - $.cookie("token", data.token); + $.cookie( + "token", + data.token, { + expires: expire(30) + } + ); } $("body").removeClass("signed-out"); @@ -291,7 +296,12 @@ $(function() { var self = $(this); var name = self.attr("name"); options[name] = self.prop("checked"); - $.cookie("settings", options); + $.cookie( + "settings", + options, { + expires: expire(365) + } + ); if ([ "join", "mode", @@ -575,7 +585,12 @@ $(function() { } }); if (values.user) { - $.cookie("user", values.user); + $.cookie( + "user", + values.user, { + expires: expire(30) + } + ); } socket.emit( event, values @@ -654,6 +669,12 @@ $(function() { location.reload(); } + function expire(days) { + var date = new Date(); + date.setTime(date.getTime() + ((3600 * 1000 * 24) * days)); + return date; + } + document.addEventListener( "visibilitychange", function() { diff --git a/package.json b/package.json index c2c5258..45009eb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shout", "description": "A web IRC client", - "version": "0.32.2", + "version": "0.32.3", "author": "Mattias Erming", "preferGlobal": true, "bin": {