php / php/doc-en

Support cookie prefixes in session name

Open
#1,994 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Verified
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked PHP manual pages for session_name and the session.name configuration directive. Update the documented character restrictions to address __Host- and __Secure- cookie prefixes, and verify that both pages describe the supported naming consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.