Trying to set cookie below ways and facing issues: Option1: document.cookie = name + "=" + value + "; expires=" + date.toUTCString() + "; path=/"; This sets value only till name=value when i recall document.cookie. Option 2: document.cookie = "${name}=value"; document.cookie = "expires=${date.toUTCString()}"; document.cookie = "path=/"; This works fine and i am able to read all the values from cookie based on ";" split. Why this odd behaviour? And in sonarqube report it says assigning document.cookie like the one in option 2 is wrong and its a bug. Continue reading...