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

Authentication->setIdentity isn't respecting Session.ini.session.cookie_path #558

Open
patrickconroy opened this issue Aug 2, 2022 · 4 comments
Milestone

Comments

@patrickconroy
Copy link

Hello. I'm seeing something weird in my app right now when calling Authentication->setIdentity. The Session.ini.session.cookie_path is getting overriden with /. In Cake\Http\Session I can see an empty array sent to __construct which means this evaluates to that /.

$cookiePath = empty($config['cookiePath']) ? '/' : $config['cookiePath'];

My cookie will respect all the other ini options I'm setting in my config (cookie_samesite, cookie_lifetime), but not cookie_path.

return [
    'Session' => [
        'cookie' => 'cookiename.....',
        'defaults' => 'database',
        'ini' => [
            'session.cookie_path' => "/path/",
            'session.cookie_lifetime' => 60 * 60 * 24 * 3,
            'session.cookie_samesite' => 'Lax',
        ]
    ]
];

cakephp/cakephp version: 4.3.10
cakephp/authentication version: 2.9.0

@markstory markstory added the bug label Aug 3, 2022
@markstory markstory added this to the 2.x milestone Aug 3, 2022
@markstory
Copy link
Member

Since you tracked down the session construction, what is the stacktrace for the session creation? Generally it is supposed to happen during ServerRequestFactory::fromGlobals() during Http server setup, so the configuration should be present unless you are setting configuration after the request has been made.

@othercorey
Copy link
Member

@patrickconroy Can you follow up on this?

@github-actions
Copy link

This issue is stale because it has been open for 120 days with no activity. Remove the stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the stale label Mar 28, 2023
@othercorey othercorey added pinned and removed stale labels Mar 28, 2023
@dereuromark
Copy link
Member

Is this still valid?

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

No branches or pull requests

4 participants