Skip to content

Support cookie prefixes in session name #1994

Description

@Sjord

Cookies can be marked with a prefix to receive certain security features in browsers. Specifically, cookies can be prefixed with __Host- or __Secure-. To use this for the PHP session ID, you would do something like this:

session_start([name => '__Host-PHPSESSID']);

Or configure a similar cookie name in the php.ini. This works as expected: sessions still work and the cookie is marked as host-only.

The problem is that the documentation says that the cookie name should be alphanumeric, and _ and - are not alphanumeric. So according to the docs the above is not supported.

I would like to see the documentation for session_name to be changed, so that cookie prefixes are considered acceptable.

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