This paper presents a technique using SHA-512 hashing to secure cookies against cross-site scripting (XSS) attacks by making them worthless to attackers. It emphasizes the vulnerabilities of cookies, which are widely targeted in XSS attacks, and outlines the proposed method of sending hashed cookie values to browsers for session management. The approach requires no modifications on the browser side and aims to enhance web application security by preventing session hijacking through stolen cookies.