aboutsummaryrefslogtreecommitdiff
path: root/js/lib/session.js
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-06-13 07:37:27 -0400
committerCash Costello <cash.costello@gmail.com>2013-06-13 07:37:27 -0400
commitbcfd141620023818cf9515ab9653d85bcf8d82e4 (patch)
tree15b5b469525323684c6e763d138fb83ea3fdfcae /js/lib/session.js
parent731b7bdde4790d2bfd565eb2d9c847f4adedf4b4 (diff)
parent160c828b75abee571d0058694c9758617a613242 (diff)
downloadelgg-bcfd141620023818cf9515ab9653d85bcf8d82e4.tar.gz
elgg-bcfd141620023818cf9515ab9653d85bcf8d82e4.tar.bz2
Merge branch '1.8' of github.com:Elgg/Elgg into 1.8
Diffstat (limited to 'js/lib/session.js')
-rw-r--r--js/lib/session.js27
1 files changed, 12 insertions, 15 deletions
diff --git a/js/lib/session.js b/js/lib/session.js
index fa3d60aa9..0fc7f5c87 100644
--- a/js/lib/session.js
+++ b/js/lib/session.js
@@ -47,21 +47,18 @@ elgg.session.cookie = function (name, value, options) {
}
cookies.push(name + '=' + value);
-
- if (elgg.isNumber(options.expires)) {
- if (elgg.isNumber(options.expires)) {
- date = new Date();
- date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
- } else if (options.expires.toUTCString) {
- date = options.expires;
- } else {
- valid = false;
- }
-
- if (valid) {
- cookies.push('expires=' + date.toUTCString());
- }
- }
+
+ if (elgg.isNumber(options.expires)) {
+ date = new Date();
+ date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
+ } else if (options.expires.toUTCString) {
+ date = options.expires;
+ }
+
+ if (date) {
+ cookies.push('expires=' + date.toUTCString());
+ }
+
// CAUTION: Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined