More session work.
This commit is contained in:
parent
60affa288e
commit
d3cd5f3c9a
@ -29,6 +29,10 @@ namespace jet {
|
|||||||
for (auto i = parent->keywords.begin(); i != parent->keywords.end(); i++)
|
for (auto i = parent->keywords.begin(); i != parent->keywords.end(); i++)
|
||||||
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
||||||
|
|
||||||
|
outFile << "*** COOKIES ***" << std::endl;
|
||||||
|
for (auto i = global.cookies.data.begin(); i != global.cookies.data.end(); i++)
|
||||||
|
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
||||||
|
|
||||||
outFile.close();
|
outFile.close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,14 @@ namespace jet {
|
|||||||
|
|
||||||
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||||
char *cookies;
|
char *cookies;
|
||||||
|
std::cout << "010" << std::endl;
|
||||||
if(keywordDefined("cgi") && (resolveKeyword("cgi") == "true")) {
|
if(keywordDefined("cgi") && (resolveKeyword("cgi") == "true")) {
|
||||||
|
std::cout << "011" << std::endl;
|
||||||
global.cgi = true;
|
global.cgi = true;
|
||||||
|
|
||||||
if(keywordDefined("sessiondir")) {
|
if(keywordDefined("sessiondir")) {
|
||||||
cookies = getenv("HTTP_COOKIE");
|
std::cout << "012" << std::endl;
|
||||||
|
global.cookies = getenv("HTTP_COOKIE");
|
||||||
global.session = true;
|
global.session = true;
|
||||||
// if request_has_cookie then
|
// if request_has_cookie then
|
||||||
// pull sessionfile from sessiondir.
|
// pull sessionfile from sessiondir.
|
||||||
@ -51,8 +54,8 @@ namespace jet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
else if(contentType == "application/x-www-form-urlencoded")
|
// else if(contentType == "application/x-www-form-urlencoded")
|
||||||
global.setupFormURLEncoded(postdata);
|
// global.setupFormURLEncoded(postdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processContainer(container);
|
processContainer(container);
|
||||||
|
@ -1,29 +1,5 @@
|
|||||||
*** CGI VARIABLES ***
|
|
||||||
*** GLOBAL VARIABLES ***
|
*** GLOBAL VARIABLES ***
|
||||||
=[xxx]
|
|
||||||
addition=[8]
|
|
||||||
complete=[ABCD;tohex]
|
|
||||||
division=[1.666666666667]
|
|
||||||
divisor=[8]
|
|
||||||
error=[64]
|
|
||||||
exprnumbers=[0123456789]
|
|
||||||
include=[yes]
|
|
||||||
ix=[1]
|
|
||||||
lefty=[01234]
|
|
||||||
modified1=[ABCD]
|
|
||||||
multiplication=[15]
|
|
||||||
nested=[64]
|
|
||||||
newname=[another container value]
|
|
||||||
noeval=[this is the value store in $[%name1].]
|
|
||||||
numbers=[0123456789]
|
|
||||||
subtraction=[2]
|
|
||||||
theexpr=[bcd]
|
|
||||||
thename=[this is the value store in .]
|
|
||||||
tohex=[tohex]
|
|
||||||
varname1=[vardata]
|
|
||||||
*** LOCAL VARIABLES ***
|
*** LOCAL VARIABLES ***
|
||||||
localvar=[This is a container set with '']
|
|
||||||
testinclude=[xThis is a container set with ''x]
|
|
||||||
*** KEYWORD VALUES ***
|
*** KEYWORD VALUES ***
|
||||||
file=[./testinclude.jet]
|
sessiondir=[.]
|
||||||
name1=[]
|
*** COOKIES ***
|
||||||
|
@ -2,4 +2,5 @@
|
|||||||
export REQUEST_METHOD=POST
|
export REQUEST_METHOD=POST
|
||||||
export CONTENT_LENGTH=619
|
export CONTENT_LENGTH=619
|
||||||
export CONTENT_TYPE=multipart/form-data
|
export CONTENT_TYPE=multipart/form-data
|
||||||
|
export HTTP_COOKIE="session=18fd56a83f"
|
||||||
cat post.example.formdata | ./testpost.jet
|
cat post.example.formdata | ./testpost.jet
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
#!../jet-2.0
|
#!../jet-2.0
|
||||||
<upload name="imagefiledata" path="images/%name" />
|
<upload name="imagefiledata" path="images/%name" />
|
||||||
<jet cgi="true">
|
<jet sessiondir=".">
|
||||||
$[:name]
|
|
||||||
$[:name:1]
|
<dump file="./dump.txt" />
|
||||||
$[:name:2]
|
|
||||||
$[:name:3]
|
|
||||||
$[:name2]
|
|
||||||
$[:name:2;tohex]
|
|
||||||
$[:name:3;tohex]
|
|
||||||
$[:name2;tohex]
|
|
||||||
<dump file="/tmp/dump.txt" />
|
|
||||||
</jet>
|
</jet>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user