From 27ffda3b67d172afca2cb85387fad27e78719480 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 29 Mar 2022 23:28:05 +0200 Subject: Split Session from HttpServlet --- NetEx/HttpSession.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 NetEx/HttpSession.h (limited to 'NetEx/HttpSession.h') 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& 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 attributes; +}; + + +#endif // HttpSession_h -- cgit v1.1