Skip to content

Cookie::fromString() always adds the HttpOnly flag #23424

Closed
@leofeyer

Description

@leofeyer
Q A
Bug report? yes
Feature request? no
BC Break report? no
Symfony version 3.3.1

The Cookie::fromString() method sets 'httponly' => true in line 49 by default.

$cookie = Cookie::fromString('foo=bar'); // foo=bar; path=/; httponly

However, I would expect the flag to be added only if explicitly given:

$cookie = Cookie::fromString('foo=bar'); // foo=bar; path=/
$cookie = Cookie::fromString('foo=bar; httponly'); // foo=bar; path=/; httponly

Otherwise there is no way to have a cookie without the HttpOnly flag, is there?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions