diff options
author | Aki <please@ignore.pl> | 2022-03-29 23:28:05 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-29 23:29:18 +0200 |
commit | 27ffda3b67d172afca2cb85387fad27e78719480 (patch) | |
tree | 6ca5f6992b54ff34d42125b03522c7227cbaa108 /NetEx/HttpSession.h | |
parent | 20eb9409e1d4d5d26222e62df4a81b0be9cae6f2 (diff) | |
download | starshatter-27ffda3b67d172afca2cb85387fad27e78719480.zip starshatter-27ffda3b67d172afca2cb85387fad27e78719480.tar.gz starshatter-27ffda3b67d172afca2cb85387fad27e78719480.tar.bz2 |
Split Session from HttpServlet
Diffstat (limited to 'NetEx/HttpSession.h')
-rw-r--r-- | NetEx/HttpSession.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/NetEx/HttpSession.h b/NetEx/HttpSession.h new file mode 100644 index 0000000..e8d67f8 --- /dev/null +++ b/NetEx/HttpSession.h @@ -0,0 +1,49 @@ +/* Starshatter: The Open Source Project + Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors + Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors + Copyright (c) 1997-2006, Destroyer Studios LLC. +*/ + +#ifndef HttpSession_h +#define HttpSession_h + +#include "HttpParam.h" +#include "List.h" +#include "Text.h" + + +class HttpSession +{ +public: + static const char* TYPENAME() { return "HttpSession"; } + + HttpSession(); + virtual ~HttpSession(); + + int operator == (const HttpSession& s) const { return id == s.id; } + + Text GenerateUniqueID(); + + Text GetID() const { return id; } + void SetID(const char* i) { id = i; } + int GetLastAccess() const { return access_time;} + void Access(); + + List<HttpParam>& GetAttributes() { return attributes; } + + Text GetAttribute(const char* name); + void SetAttribute(const char* name, const char* value); + void DelAttribute(const char* name); + + int GetIntAttribute(const char* name); + void SetIntAttribute(const char* name, int value); + void DelIntAttribute(const char* name); + +protected: + Text id; + int access_time; + List<HttpParam> attributes; +}; + + +#endif // HttpSession_h |