Note: HttpOnly cookies cannot be created via client-side JS. Use server-side Set-Cookie for that.
document.cookie