I had a request to remove the HttpOnly attribute from a cookie, but that's not supported by default. Looking at the codebase, it seems that by default HttpOnly was set to FALSE in Drupal 7, but now uses the TRUE default set by the Symfony HttpFoundation Cookie constructor.

The ideal resolution would be a configurable option, defaulting to true, on whether to set this value.

A workaround patch has been included which forces the value to false, but a full configurable feature still needs to be written and tested.

Comments

dieuwe created an issue. See original summary.

dieuwe’s picture

I haven't got time to work on a fully configurable option, so here is just a patch which will always remove the HttpOnly attribute from the cookie when included.

dieuwe’s picture

Issue summary: View changes
pakmanlh’s picture

Status: Active » Needs review
Issue tags: +Needs review
StatusFileSize
new2.88 KB

Nice catch @dieuwe! Here you have a patch that allows to config the http_only value following the same way the others settings work. Cheers!

jeroent’s picture

StatusFileSize
new6.85 KB
jeroent’s picture

I updated patch #4 so the default value is TRUE since that is currently the expected value.

+ I added a config schema and test coverage.

jeroent’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-1.x. Thanks!

  • JeroenT committed 6d8c44c on 8.x-1.x
    Issue #3197378 by dieuwe, JeroenT, pakmanlh: Add option to disable...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.