in chrome, run
<html>
<body>
<button id="cookie">test</button>
<script>
function setCookie()
{
document.cookie = "flag=1;expires="";path=/";
}
ob = document.getElementById("cookie");
ob.addEventListener("click",setCookie);
</script>
</body>
</html>
After the web page is opened, cookie is generated, but after closing the web page and reopening it, the cookie is still there, not a session cookie, excuse me, how to use js to generate session cookie?
document.cookie = "flag=1;expires=0;path=/"; can"t do it