httpOnly
cookies provide a layer of XSS defence that localStorage
does not provide:
httpOnly
cookies are not accessible from [potentially malicious] JS.
localStorage
is accessible from JS.
Session IDs should be stored in httpOnly
secure
cookies.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…