guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 119 forks source link

use 'persistent' cookie for 'graphic content' blurring (rather than session cookie) #4189

Closed twrichards closed 8 months ago

twrichards commented 8 months ago

Turns out that Angular's $cookies library defaults to session cookies (which I didn't spot, since the extension I was using to view the cookies whilst developing showed an expiry time).

This PR adds an expires property to the cookie when setting it (set to today plus 399 days - the max expiry enforced by some browsers) and if the cookie exists it resets it every page load to effectively extend the expiry indefinitely (that also cleans-up/replaces the old 'session' cookies).

prout-bot commented 8 months ago

Seen on auth, usage, metadata-editor, thrall, leases, cropper, collections, kahuna (merged by @twrichards 8 minutes and 58 seconds ago) Please check your changes!

prout-bot commented 8 months ago

Seen on image-loader (merged by @twrichards 9 minutes and 6 seconds ago) Please check your changes!

prout-bot commented 8 months ago

Seen on media-api (merged by @twrichards 9 minutes and 18 seconds ago) Please check your changes!