Changes for code getcookies
Posted: Mon Aug 12, 2019 3:48 pm
Hi to all
I made a change in this code adding the alltrim() to cCookie variable.
Without this in some situation the functions gives error.
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
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