![]() |
Problem mit IdHTTPserver Session
Liste der Anhänge anzeigen (Anzahl: 2)
Hi Leute,
ich taste mich mal wieder an das Thema IdHTTPServer / Session ran. Bisher habe ich das immer irgendwie anders gelöst, aber nun möchte ich das mal mit der integrierten Session probieren. Session wird auch erstellt, aber wenn ich dort Content ablegen will habe ich ein Problem.
Delphi-Quellcode:
Und im OnCommand
FHttpServer.OnCommandGet:=OnCommand;
FHttpServer.Bindings.Clear; FHttpServer.DefaultPort:=FPort; FHttpServer.SessionState:=True; FHttpServer.AutoStartSession:=True; FHttpServer.SessionTimeOut:=5000; FHttpServer.Active:=True;
Delphi-Quellcode:
Im ersten ARequestInfo.Session.Content.AddPair existiert "Content" noch.
try
user:=GetField(ARequestInfo, 'Username'); pass:=GetField(ARequestInfo, 'Password'); if (user<>'') and (pass<>'') then begin u:=FUserList.Login(user, pass); if u<>nil then begin ARequestInfo.Session.Content.AddPair('Username', u.Username); ARequestInfo.Session.Content.AddPair('Guid', u.Guid); ... Beim zweiten ist Content dann nil. (siehe Anhang). Wie macht man's richtig? Gibt's irgendwo mal ein richtig gutes Tutorial für das alles? |
AW: Problem mit IdHTTPserver Session
Probiers mal mit RequestInfo.Session.Lock / .unlock
|
AW: Problem mit IdHTTPserver Session
Zitat:
Delphi-Quellcode:
Funktioniert, jedoch nur zur Runtime.
ARequestInfo.Session.Lock;
ARequestInfo.Session.Content.AddPair('Username', u.Username); ARequestInfo.Session.Content.AddPair('Guid', u.Guid); ARequestInfo.Session.Unlock; Beim Debuggen ist Content im zweiten AddPair = nil. Ich glaube aber so komme ich weiter. Danke schön :-) |
AW: Problem mit IdHTTPserver Session
Zitat:
|
AW: Problem mit IdHTTPserver Session
Probier Mal Server.EndSession(RequestInfo.Session.SessionID)
|
AW: Problem mit IdHTTPserver Session
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:12 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz