I try to readout set cookies by SB. Unfortunately there is no explicit SB function existing or lets say I did not find it.
It is no problem doing it by calling a php script but I would like to read it out directly without internet traffic.
However, I tried following
Code: Select all
Procedure js_cookies(mode.i,cname.s)
Select mode ;Read cookies
Case 0
!function getCookie(cname){
! let name = cname + "=";
! let decodedCookie = decodeURIComponent(document.cookie);
! let ca = decodedCookie.split(';');
! for(let i = 0; i <ca.length; i++) {;
! while (c.charAt(0) == ' ') {
! c = c.substring(1);
! }
! if (c.indexOf(name) == 0) {
! return c.substring(name.length,c.length);
! }
! }
! return "";
!}
ProcedureReturn !getCookie(cname) ;<<-- does not work
EndSelect
js_cookies(0,"cookiename")
;JS code from W3Schools.com !
EndProcedure
Thanks for useful hints.
[edit:]
additionally information. I found some code here viewtopic.php?t=1361 but as soon I run app with enabled procedure, no more window appears. It is not necessary to call procedure for this effect happens. As soon I make a block comment to the procedure app works fine. With above shown code this effect is not appearing.