คุณสามารถใช้ที่จัดเก็บในเครื่องใน HTML5 เพื่อจุดประสงค์นี้ Local Storage ได้รับการออกแบบสำหรับการจัดเก็บที่ครอบคลุมหลายหน้าต่างและอยู่ได้นานกว่าเซสชันปัจจุบัน โดยเฉพาะอย่างยิ่ง เว็บแอปพลิเคชันอาจต้องการจัดเก็บข้อมูลผู้ใช้หลายเมกะไบต์ เช่น เอกสารที่ผู้ใช้สร้างขึ้นทั้งหมดหรือกล่องจดหมายของผู้ใช้ ทางฝั่งไคลเอ็นต์เพื่อเหตุผลด้านประสิทธิภาพ
<!DOCTYPE HTML>
<html>
<body>
<script>
if( localStorage.hits ){
localStorage.hits = Number(localStorage.hits) +1;
} else{
localStorage.hits = 1;
}
document.write("Total Hits :" + localStorage.hits );
</script>
<p>Refresh the page to increase number of hits.</p>
<p>Close the window and open it again and check the result.</p>
</body>
</html