3ddark 3 Posted yesterday at 08:26 AM I am having problems with the Delphi Web Server Application. I create a cookie and set it as a value The cookie value comes as ELEKTRON%C4%B0K from the browser. LCookValues.AddPair('name', 'ELEKTRONİK'); Response.SetCookieField(LCookValues, HOST_ADDR, '/', IncDay(Now, 15), False); When I use it with Base64 encoding, the encoding result is RUxFS1RST07EsEs= But the result on the browser is RUxFS1RST07EsEs%3D TNetEncoding.Base64String.Encode('ELEKTRONİK') The place where the characters are broken is in the function below. How can I fix this situation? procedure TIdHTTPAppResponse.MoveCookiesAndCustomHeaders; ..... begin ... LDestCookie.Value := DoHTTPEncode(LSrcCookie.Value); ... end; When I test Base64 encode/decode online from any site, the extra characters give incorrect results. When I want to use this cookie in other requests, I use it as follows. TNetEncoding.Base64String.Decode(Request.CookieFields.Values['name']) As a result, the information I receive is ELEKTRONİK7 This is not my correct information. Share this post Link to post
3ddark 3 Posted yesterday at 09:15 AM TNetEncoding.Base64String.Decode(TNetEncoding.URL.Decode(Request.CookieFields.Values['name'])) Use like this working. But constantly converting things is a waste of time. Where am I going wrong? There must be an easier way. Other web tools do not have any of these problems. We can solve all web processes very easily. Share this post Link to post