Ben şuan yapamadım. Teoride şunun çalışması gerekmiyor mu?
module library.cookie;
import std.process; // getenv
import std.string;
import std.uri;
import library.fixedString;
import std.conv;
import std.cstream;
string[string] cookie()
{
string[string] endCookie;
string cookie = getenv("HTTP_COOKIE");
endCookie=fixedString(decode(cookie));
return endCookie;
}
void setCookie(string name, string data, long expiresIn = 0, string path = null, string domain = null, bool httpOnly = false)
{
std.stdio.writeln("Set-Cookie: deneme=veriler");
}
void main(){
dout.writef("Content-type: text/html; charset=utf-8\n\n");
setCookie("deneme", "veriler" );
dout.writef("<html>\n <body>\n");
dout.writef("\n<hr>\n<b>Ortam değişkenleri:</b><br><br>\n");
std.stdio.writeln(cookie());
dout.writef("\n<hr><br>\n<a href=\"http://ddili.org/ornek_kod/deneme.d\">"
"(Bu çıktıyı oluşturan program)</a><br>\n");
dout.writef("\n </body>\n</html>\n");
}
--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]