Changes for code getcookies

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Changes for code getcookies

Postby Massimo Linossi » 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.

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
 
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Changes for code getcookies

Postby Antonio Linares » Fri Aug 16, 2019 6:54 am

thank you!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 8 guests