reactphp / reactphp/http

HTTP client: Support for handling cookies

Open
#445 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
PHP
Stars
781
Forks
166
PR merge metrics
No merged PRs in 30d

Description

While I was trying to port some blocking libcURL code to ReactPHP I found there is no support for handling cookies when using the HTTP client. Inspired by other clients (especially cURL) I propose that the following features should be added:

  • compliance with HTTP State Management Mechanism (expiration, send the cookie only to the corresponding domain, etc.)
  • cookie support can be enabled/disabled
  • cookies can be added/removed manually
  • serialization/deserialization to/from a format like Netscape Cookie Jar (ideally this should be decoupled so other formats could be easily added)

As suggested by @WyriHaximus, storing the cookie jar could be done with react/cache which I find totally ok. Saving and loading to/from files could be implemented by the user or we could build something on top of ArrayCache.

After we settle the details of this, I would be happy to implement it :D

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 by reviewing RFC 6265 and the ReactPHP HTTP client implementation to resolve the proposed cookie-jar design and storage boundaries. Define how enabling, disabling, manual changes, expiration, domain matching, and serialization should work; done means the agreed behavior is implemented and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.