Have a look at the unit WEBLib.Cookies that offers the TCookies collection for managing cookies.
Is there any documentation somewhere ?
Sorry to insist, but I need this, there is no documentation, nothing else on the forum, and nothing on th web.
What exact error do you get at design-time, as WEBLib.Cookies is unit that has the TCookies collection class and not really design-time behavior.
"Cannot resolve unit name 'WEBLib.Cookies'"
You should have WEBLib.Cookies.pas in the source subfolder "Component Library Source" of your TMS WEB Core install and this folder should be in your IDE library path. Can you double check this.
The file is in the subfolder, but I hadn't the folder in the IDE library path. I added it, but nothing changed.
Cookies := TCookies.Create;
Cookies.Add('mycookie','789', Now + 3);
Thank you very much Feichtenschlager, this is exactly what I expected !
function PR_getCookie: string; var VLOcookies: TCookies; VLOcookie: TCookie; begin Result := ''; VLOcookies := TCookies.Create; try VLOcookies.GetCookies; VLOcookie := VLOcookies.Find('name'); if Assigned(VLOcookie) then begin Result := VLOcookie.Value; end; finally VLOcookies.Free; end; end; procedure PR_setCookie(p_value: string); var VLOcookies: TCookies; begin VLOcookies := TCookies.Create; try VLOcookies.Add('name', p_value); VLOcookies.SetCookies; finally VLOcookies.Free; end; end; procedure PR_deleteCookie; var VLOcookies: TCookies; begin VLOcookies := TCookies.Create; try VLOcookies.GetCookies; VLOcookies.Delete('name'); VLOcookies.SetCookies; finally VLOcookies.Free; end; end;
I still have errors at design-time. I tried to had the "Component Library Source" in the library path called "Path", and to create a new one called "TMS" or "WEBCORE".
what exact error?
Same as before :
The only reason I can see for this is that your IDE library path is not setup correct.
You can verify this yourself. Search WEBLIB.Cookies.pas in Component Library Source. You should find this file and you should make sure the path where this file is, is in your IDE library path.
Library path "PATH" has the folder deifned too.
The Delphi IDE library path is in the IDE under Tools, Options, Delphi Options, Library
My bad, you're right. Thank you very much !