Help with Javascript

Das Goravani goravanis at
Fri Nov 18 16:22:29 UTC 2022

Dear All,

I am trying to write and read a cookie using Javascript from Omnis.

I looked up reading and writing cookies on the web and found help.

To write a cookie they say you only need this much:

JavaScript:document.cookie = "username=John Doe; expires=Thur, 18 Dec 2030 12:00:00 UTC; path=/";

The path is recommended but optional, I will add it when I find out how to know the URL/path of an operating remote form page. 

So I have shortened it to this:

JavaScript:document.cookie = "1st=23; expires=Thur, 18 Dec 2030 12:00:00 UTC";

To read a cookie you only need this:

JavaScript:let x = document.cookie;

I learned from a developer that you can just put in vars and so I am asking it this:

JavaScript:let locald = document.cookie;

Do I need the "var" before it:

JavaScript:let var locald = document.cookie;

I’m not getting any results back. So either I’m not writing the cookie or not retrieving it. 

Any help appreciated. 

More information about the omnisdev-en mailing list