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

[1.13] Allow setting cookie session=false #676

Closed
wants to merge 3 commits into from

Conversation

divinity76
Copy link
Contributor

Previously

$page->setCookies([
    \HeadlessChromium\Cookies\Cookie::create("session_false", "session_false", ["session" => false, "domain" => "example.com"]),
    \HeadlessChromium\Cookies\Cookie::create("session_true", "session_true", ["session" => true, "domain" => "example.com"]),
])->await();

would create 2 cookies with session=true, but now it will create 1 cookie with session=false and 1 with session=true

close GH-675

HenryVolkmer and others added 3 commits January 3, 2025 20:07
Previously
```php
$page->setCookies([
    \HeadlessChromium\Cookies\Cookie::create("session_false", "session_false", ["session" => false, "domain" => "example.com"]),
    \HeadlessChromium\Cookies\Cookie::create("session_true", "session_true", ["session" => true, "domain" => "example.com"]),
])->await();
```
would create 2 cookies with session=true, but now it will create 1 cookie with session=false and 1 with session=true

close chrome-phpGH-675
@GrahamCampbell GrahamCampbell changed the title allow setting cookie session=false [1.13] Allow setting cookie session=false Feb 7, 2025
@GrahamCampbell GrahamCampbell changed the base branch from 1.12 to 1.13 February 7, 2025 17:41
@GrahamCampbell
Copy link
Member

This PR contains unrelated changes. I'm going to put in the

            if (!isset($cookie['expires']) && ($cookie['session'] ?? null) === false) {
                $browserCookie['expires'] = \time() + (1 * 60 * 60 * 24 * 365);
            }

change, only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Unable to create cookies with session=false
4 participants