Client only cookies - cookie which doesn't ever go to the server

Siva Bathula picture Siva Bathula · Jun 18, 2012 · Viewed 9.1k times · Source

I want to store user-clicked data in a cookie which never has to go to the server. Its like a session-added data, which I want to persist over sessions, as in the data just keeps adding to the cookie, and it is stored for a long time, and only gets deleted when the user removes browsing history. The cookie is pure-client only cookie and it never has to go the server, as I don't need the user generated data at the server, so I want to get rid of the additional overhead the cookie creates in sending back and forth between browser and server. Is it possible to achieve this?

Answer

Franz Deschler picture Franz Deschler · Nov 4, 2013

I know it´s a little late for you, but this answer is for all who have the same problem.

1) With HTML5 you can use [web storage][1].

2) (Just an idea! - not tested!) You could define a cookie (via javascript on client) and set the "secure"-attribute. In this case, the cookie will only be sent to the server on HTTPS connections. To make sure the cookie never leaves the browser, you just never open a HTTPS connection ;-)