summaryrefslogtreecommitdiff
path: root/src/Cookie.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-01-28 14:01:50 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-01-28 14:01:50 +0000
commit4043b6ccae25087c4a707b6ff687026e3447b8d3 (patch)
tree7ea9b56598e4e3e0ae8f6becc34ac1088c090f49 /src/Cookie.h
parent60c16887e6ff43c6266e5c0013e63dd3a1cf6019 (diff)
2010-01-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Cookie storage. * src/Cookie.cc * src/Cookie.h * src/CookieParser.cc * src/CookieStorage.cc * src/CookieStorage.h * src/a2functional.h * test/CookieParserTest.cc * test/CookieStorageTest.cc * test/CookieTest.cc * test/HttpResponseTest.cc * test/TestUtil.h * test/a2functionalTest.cc
Diffstat (limited to 'src/Cookie.h')
-rw-r--r--src/Cookie.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Cookie.h b/src/Cookie.h
index e88ebd25..9b223aaa 100644
--- a/src/Cookie.h
+++ b/src/Cookie.h
@@ -52,6 +52,8 @@ private:
std::string _path;
std::string _domain;
bool _secure;
+ time_t _creationTime;
+ time_t _lastAccess;
public:
/*
* If expires = 0 is given, then the cookie becomes session cookie.
@@ -127,6 +129,24 @@ public:
}
std::string toNsCookieFormat() const;
+
+ // Makes this Cookie only sent to the origin server. This function
+ // removes first "." from _domain if _domain starts with ".".
+ void markOriginServerOnly();
+
+ time_t getCreationTime() const
+ {
+ return _creationTime;
+ }
+
+ void updateLastAccess();
+
+ time_t getLastAccess() const
+ {
+ return _lastAccess;
+ }
+
+ static std::string normalizeDomain(const std::string& domain);
};
typedef std::deque<Cookie> Cookies;