Bug 12410

Summary: Remove useless use of cookies
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 9366, 24625    
Bug Blocks:    

Description Jonathan Druart 2014-06-12 14:37:35 UTC
It seems that the 'show/hide marc tag field' enhancement, introduced by bug 9366, uses cookie when the HTML5 localStorage DB could be used.
Comment 1 Owen Leonard 2020-02-10 19:44:48 UTC
The only reason I can think of that we would want to change this is if we're concerned about the 365-day expiration of these cookies.

Is there another factor behind this bug?
Comment 2 Jonathan Druart 2020-02-11 12:14:32 UTC
Cookies are returned to the server, then back to the client.

I do not think we should use them when not needed, here it is only needed client-side, and can be replaced with local storage.

Also, privacy, useless data going through the network, etc.
Comment 3 Jonathan Druart 2020-08-07 12:33:35 UTC
Same for search_path_code
Comment 4 Marcel de Rooy 2022-10-27 05:48:04 UTC
(In reply to Jonathan Druart from comment #3)
> Same for search_path_code

Agreed. Seeing useless warnings like this one too:
[2022/10/27 00:49:23] [WARN] ReturnPath switch error at /usr/share/koha/opac/opac-search.pl line 215.
Caused by an unexpected value in search_path_code.
Comment 5 David Cook 2022-10-27 22:48:47 UTC
(In reply to Jonathan Druart from comment #2)
> Cookies are returned to the server, then back to the client.
> 
> I do not think we should use them when not needed, here it is only needed
> client-side, and can be replaced with local storage.
> 
> Also, privacy, useless data going through the network, etc.

I've been thinking about this lately, and the only issue I can think of relates to shared devices. 

In the case of the staff interface, you can have shared circ terminals, although it's probably not a drama.

I'm thinking more about public OPAC terminals at libraries. If a user closes the browser, I don't think the local storage gets cleared. HTML5 session storage might work although I think its scoping differs a fair bit from session cookies. 

I suppose it'll differ on a case by case basis...

Anyway, I think it would be interesting to take advantage of local storage and session storage more often for sure.