Logic Machine Forum
Cookies in LogicMachine app - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Application Store (https://forum.logicmachine.net/forumdisplay.php?fid=11)
+--- Thread: Cookies in LogicMachine app (/showthread.php?tid=5333)



Cookies in LogicMachine app - rbourgeon - 03.04.2024

Hello,

I read the following paragraph in the documentation for creating LogicMachine apps:



[Image: cookies-documentation.png]


However, in my JavaScript code, the object "Cookie" is unknown:

[Image: Cookie-not-defined.png]

so, in JavaScript, how do access this "Cookie global object" referenced in the documentation?


RE: Cookies in LogicMachine app - admin - 03.04.2024

You need to load the libraries before using Cookie functions:
Code:
<script src="/apps/js/jquery.js.gz"></script>
<script src="/apps/js/apps.js.gz"></script>

Alternatively you can use localStorage: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage