Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1027639 // hJsMakeCookie

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2388L/15K).

sS hJsMakeCookie() {
  ret hjavascript([[
    var cookie = localStorage.getItem('cookie');
    var urlParams = new URLSearchParams(window.location.search);
    console.log("cookie 1: " + cookie);
    if (!cookie) {
      cookie = Math.random().toString(36).substr(2, 9);
      localStorage.setItem('cookie', cookie);
      console.log("cookie 2: " + cookie);
    }
  ]]);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027639
Snippet name: hJsMakeCookie
Eternal ID of this version: #1027639/2
Text MD5: 6e2db546f42229fbf10fb019b821e1e8
Transpilation MD5: ea4fb43c50cb68d749dc6decad611783
Author: stefan
Category: javax / javascript
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-27 23:06:08
Source code size: 384 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 248 / 340
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1029506 - hs_htmlencode_noJQuery