diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-10-26 14:22:58 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-10-26 14:22:58 +0000 |
| commit | 915aa676f8d980dcf2bf88154037b6df0edc3b58 (patch) | |
| tree | 1faf54d86f073268088855eade4e50f699b5a178 /src/Cookie.h | |
| parent | 8a920ba5e38b8a7c43dc088b1837026e69b078f3 (diff) | |
2008-10-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Treat Cookie object as session cookie if expiry = 0 is given.
With this change, you can specify session scoped cookies in an
external file setting expiry value to 0.
* src/Cookie.cc
* src/Cookie.h
* test/CookieParserTest.cc
* test/CookieStorageTest.cc
* test/CookieTest.cc
Diffstat (limited to 'src/Cookie.h')
| -rw-r--r-- | src/Cookie.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Cookie.h b/src/Cookie.h index 9052a629..b1b98573 100644 --- a/src/Cookie.h +++ b/src/Cookie.h @@ -36,10 +36,12 @@ #define _D_COOKIE_H_ #include "common.h" -#include "a2time.h" + #include <string> #include <deque> +#include "a2time.h" + namespace aria2 { class Cookie { @@ -50,10 +52,10 @@ private: std::string _path; std::string _domain; bool _secure; - - // If true, this cookie will expire when aria2 exits. - bool _onetime; public: + /* + * If expires = 0 is given, then the cookie becomes session cookie. + */ Cookie(const std::string& name, const std::string& value, time_t expires, @@ -61,6 +63,10 @@ public: const std::string& domain, bool secure); + /* + * Creates session cookie. This is equivalent to + * Cookie(name, value, 0, path, domain, secure); + */ Cookie(const std::string& name, const std::string& value, const std::string& path, @@ -97,7 +103,7 @@ public: bool isSecureCookie() const; - bool isOnetimeCookie() const; + bool isSessionCookie() const; }; typedef std::deque<Cookie> Cookies; |
