I'm reading Roy Fielding's dissertation Architectural Styles and the Design of Network-based Software Architectures, which introduces the REST architectural style.
Roy explains that cookies are a violation of REST as they introduce stateful behaviour - cached responses may no longer apply (for example, hitting the back button), and server-side statelessness is a constraint of REST.
There is no reason why the client should not maintain state however, this is perfectly acceptable.
So if I have a RESTful API - for an online store for example - and I want to persist user state client side for a long time - between multiple sessions, are there any alternatives to using cookies to persist local state in modern browsers?
Are there any ways I can create client-side-only cookies?
This question is related a similar question about cookies for authentication in REST...
...but in my case I am not concerned with authentication strategies - just in how to persist state between sessions without sending state to the server.
To give the discussion better context, when talking about cookie based authentication, Roy says:
cookie-based applications on the Web will never be reliable. The same functionality should have been accomplished via anonymous authentication and true client-side state.