I made a change in this code adding the alltrim() to cCookie variable.
Without this in some situation the functions gives error.
- Code: Select all Expand view RUN
function GetCookies()
local hHeadersIn := AP_HeadersIn()
local cCookies := If( hb_HHasKey( hHeadersIn, "Cookie" ), hb_hGet( hHeadersIn, "Cookie" ), "" )
local aCookies := hb_aTokens( cCookies, ";" )
local cCookie, hCookies := {=>}
for each cCookie in aCookies
hb_HSet( hCookies, SubStr( alltrim(cCookie), 1, At( "=", alltrim(cCookie) ) - 1 ),;
SubStr( alltrim(cCookie), At( "=", alltrim(cCookie)) + 1 ) )
next
return hCookies