PHP-Auth icon indicating copy to clipboard operation
PHP-Auth copied to clipboard

Session problem with Brave browser

Open toffler1 opened this issue 3 years ago • 5 comments

Thanks for this awesome library - I'm using it a lot. However, I'm facing session problems with brave browser and since there are a few people using this browser, I just wanted to mention it. It instantly looses session after login. When login with the "remember me" option for 1 year, it keeps the session for a few minutes with brave.

toffler1 avatar Apr 19 '22 05:04 toffler1

Thank you!

What version of Brave (and on what OS) are you using?

Could you open the developer tools and check the status of the two cookies, i.e. if they are created, with what parameters, and when they are lost? It’s probably best to start with a clean state of zero cookies for the domain.

ocram avatar Apr 19 '22 10:04 ocram

And does your site happen to use frames?

ocram avatar Apr 19 '22 10:04 ocram

I'm using Version 1.37.116 Chromium: 100.0.4896.127 on windows 10 64 Bit.

The 2 cookies are created: image

and should last the whole session. All the PHP session variables are created as well - but only if i read them right after $auth->login($_POST['email'], $_POST['password']) ... 1 click on the page and the PHP session variables are gone, but the 2 cookies remain.

toffler1 avatar Apr 19 '22 17:04 toffler1

Thank you!

That could be the cause of the problem already. There should only be one session cookie (“PHPSESSID”). So these two are always re-created, even if you delete them entirely (and any other cookies for the domain)? If there are two, that could lead to a conflict, where the server does not receive the cookie it expects but the other one.

With “remember me” enabled, that should then be three cookies in your setup?

ocram avatar Apr 23 '22 17:04 ocram