aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-09-08 22:38:43 -0700
committerGlenn Morris2010-09-08 22:38:43 -0700
commitc4ae64d106173b3e63581a42e5ffb9ea76b5441d (patch)
tree69bdd30fddcb11ce566cb988998cdd089ceec81a
parent966bb6c00556a2409178592ebd0207b010fa14af (diff)
downloademacs-c4ae64d106173b3e63581a42e5ffb9ea76b5441d.tar.gz
emacs-c4ae64d106173b3e63581a42e5ffb9ea76b5441d.zip
* lisp/url/url-cookie.el (url-cookie-expired-p): Tweak previous change.
-rw-r--r--lisp/url/ChangeLog4
-rw-r--r--lisp/url/url-cookie.el13
2 files changed, 9 insertions, 8 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 0192987907c..11d48f97fbf 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,7 @@
12010-09-09 Glenn Morris <rgm@gnu.org>
2
3 * url-cookie.el (url-cookie-expired-p): Tweak previous change.
4
12010-09-09 shawn boles <shawn.boles@gmail.com> (tiny change) 52010-09-09 shawn boles <shawn.boles@gmail.com> (tiny change)
2 6
3 * url-cookie.el (url-cookie-expired-p): Simplify and fix. (Bug#6957) 7 * url-cookie.el (url-cookie-expired-p): Simplify and fix. (Bug#6957)
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index 810e0e4eb58..2067f097224 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -1,7 +1,7 @@
1;;; url-cookie.el --- Netscape Cookie support 1;;; url-cookie.el --- Netscape Cookie support
2 2
3;; Copyright (C) 1996, 1997, 1998, 1999, 2004, 3;; Copyright (C) 1996, 1997, 1998, 1999, 2004, 2005, 2006, 2007, 2008,
4;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 4;; 2009, 2010 Free Software Foundation, Inc.
5 5
6;; Keywords: comm, data, processes, hypermedia 6;; Keywords: comm, data, processes, hypermedia
7 7
@@ -193,12 +193,9 @@ telling Microsoft that."
193 (setq url-cookie-storage (list (list domain tmp)))))))) 193 (setq url-cookie-storage (list (list domain tmp))))))))
194 194
195(defun url-cookie-expired-p (cookie) 195(defun url-cookie-expired-p (cookie)
196 "Returns true if COOKIE is expired. 196 "Return non-nil if COOKIE is expired."
197If COOKIE has an expiration date it is converted to seconds, adjusted to the client timezone and then compared against (float-time)." 197 (let ((exp (url-cookie-expires cookie)))
198 (let* ((exp (url-cookie-expires cookie)) 198 (and exp (> (float-time) (float-time (date-to-time exp))))))
199 (exp-time (and exp (float-time (date-to-time exp)))))
200 (if (not exp) nil (> (float-time) exp-time)))
201 )
202 199
203(defun url-cookie-retrieve (host &optional localpart secure) 200(defun url-cookie-retrieve (host &optional localpart secure)
204 "Retrieve all the netscape-style cookies for a specified HOST and LOCALPART." 201 "Retrieve all the netscape-style cookies for a specified HOST and LOCALPART."