Page 1 of 1

Changes for code getcookies

Posted: Mon Aug 12, 2019 3:48 pm
by Massimo Linossi
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.

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
 

Re: Changes for code getcookies

Posted: Fri Aug 16, 2019 6:54 am
by Antonio Linares
thank you!