Форум: "Прочее";
Текущий архив: 2007.09.30;
Скачать: [xml.tar.bz2];
ВнизCookies в Delphi. Нашел статью, в Комп.Пресс (март 2006) Найти похожие ветки
← →
Vlad Oshin © (2007-09-01 15:51) [0]http://compress.ru/article.aspx?id=16098&iid=736
там написано, что материал на диске.
Никто не может поделится? или написать свой вариант
интересует как заслать куком что-то и затем считать.
← →
Vlad Oshin © (2007-09-01 16:39) [1]нашел
← →
Denis_ © (2007-09-01 16:40) [2]
> нашел
так покажи
← →
Vlad Oshin © (2007-09-02 00:47) [3]потрял уже
да там, просто все. Только ставится кук только в заголовке, после "Content-type: text/html"
------------
function getvar(varname:string):string;
var
buffer:array[0..1024] of char;
size:integer;
begin
size:=GetEnvironmentVariable(PChar(varname),buffer,sizeof(buffer));
if size=0 then getvar:="" else getvar:=String(buffer);
end;
function getcookie(name:string):string;
var
cookie:string;
p:byte;
begin
cookie:=GetVar("HTTP_COOKIE");
name:=name+"="; p:=pos(name,cookie);
if p=0 then
Result:=""
else begin
Delete(cookie,1,p+length(name)-1);
p:=pos(";",cookie);
if p=0 then p:=pos(" ",cookie);
if p=0 then p:=length(cookie)+1;
result:=copy(cookie,1,p-1);
end;
end;
procedure setcookie(name,value:string);
begin
WriteLn("Set-Cookie: ",Name,"=",Value);
end;
--------------------
WriteLn("Content-type: text/html");
SetCookie("Security",""); // efface le cookie
GetCookie("Security")
------------------
Страницы: 1 вся ветка
Форум: "Прочее";
Текущий архив: 2007.09.30;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.07 c