Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cookie API #5420

Merged
merged 9 commits into from
Jul 24, 2024
Merged

New cookie API #5420

merged 9 commits into from
Jul 24, 2024

Conversation

matyhtf
Copy link
Member

@matyhtf matyhtf commented Jul 23, 2024

 $server = new Swoole\Http\Server('0.0.0.0', $pm->getFreePort(), SWOOLE_BASE);
  $server->on('request', function (Swoole\Http\Request $request, Swoole\Http\Response $response) use ($pm) {
      $cookie = new Swoole\Http\Cookie();
      $cookie->withName('key1')
          ->withValue('val1')
          ->withExpires(time() + 84600)
          ->withPath('/')
          ->withDomain('id.test.com')
          ->withSecure(true)
          ->withHttpOnly(true)
          ->withSameSite('None')
          ->withPriority('High')
          ->withPartitioned(true);
      $response->setCookie($cookie);
      $response->end("<h1>Hello Swoole. #" . rand(1000, 9999) . "</h1>");
  });
  $server->start();

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.68%. Comparing base (006f870) to head (5df6776).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5420      +/-   ##
==========================================
- Coverage   70.69%   70.68%   -0.02%     
==========================================
  Files         107      107              
  Lines       16395    16395              
  Branches     3016     3016              
==========================================
- Hits        11591    11588       -3     
- Misses       4749     4752       +3     
  Partials       55       55              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matyhtf matyhtf merged commit b21b8d9 into master Jul 24, 2024
71 of 81 checks passed
@matyhtf matyhtf deleted the NathanFreeman-cookies branch July 24, 2024 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants