Working on CGI session stuff.
This commit is contained in:
1 parent
8b38617b00
commit
7e835e5073
3 files changed
+14
-14
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include "Exception.h"
|
||||
#include "Global.h"
|
||||
#include "SessionId.h"
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
@@ -15,22 +16,21 @@ namespace jet {
|
||||
if(keywordDefined("sessiondir")) {
|
||||
global.session = true;
|
||||
global.cookies = getenv("HTTP_COOKIE");
|
||||
|
||||
// if request_has_cookie then
|
||||
if(global.cookies.data["session"] != NULL) {
|
||||
// pull sessionfile from sessiondir.
|
||||
// if last activity time is expired then ignore.
|
||||
// follow sessiontimeoutredirecturl.
|
||||
// else
|
||||
SessionId sessionId;
|
||||
global.headers["Set-Cookie"] << "session=" << sessionId;
|
||||
if(keywordDefined("sessiontimeout")) {
|
||||
time_t timeout = time(0) + keywords["sessiontimeout"].asInteger();
|
||||
// follow sessiontimeoutredirecturl.
|
||||
} else {
|
||||
SessionId sessionId;
|
||||
global.headers["Set-Cookie"] << "session=" << sessionId;
|
||||
global.cookies.data["session"] = sessionId;
|
||||
if(keywordDefined("sessiontimeout")) {
|
||||
time_t timeout = time(0) + keywords["sessiontimeout"].asInteger();
|
||||
}
|
||||
// also save last activity time in session file.
|
||||
}
|
||||
|
||||
// also save last activity time in session file.
|
||||
|
||||
}
|
||||
|
||||
|
||||
coreutils::ZString requestMethod(getenv("REQUEST_METHOD"));
|
||||
if(requestMethod == "POST") {
|
||||
coreutils::ZString contentLength(getenv("CONTENT_LENGTH"));
|
||||
|
||||
Reference in new issue
Block a user