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

Compatibility with Redis for User Sessions #288

Open
surrealzerg opened this issue Jun 24, 2023 · 0 comments
Open

Compatibility with Redis for User Sessions #288

surrealzerg opened this issue Jun 24, 2023 · 0 comments

Comments

@surrealzerg
Copy link

surrealzerg commented Jun 24, 2023

Is this compatible? So far I'm unable to get it working. Redis is installed and PHP is configured for user sessions. This is confirmed working using below snippet. Each time you send a request with a given PHPSESSID, the counter increments by one.

<php start tag
session_start();
if (!isset($_SESSION['counter'])) {
$_SESSION['counter'] = 0;
}
$_SESSION['counter']++;
echo "Page views: " . $_SESSION['counter'];
php end tag>

After clearing all cache in the browser, I login to the app. The below call to auth->login does not throw an exception, so it seems like that is still working.

$auth->login($_POST['email'], $_POST['password']);

In the HTTP response, I do not see a new cookie being set. Normally a new cookie is set post auth.

Then I visit an authenticated page.

The below code runs, and basically the user is never being shown as logged in. I also notice a new cookie being set, which doesn't seem normal.
if ($auth->isLoggedIn()) {

I'm currently going through this link to try to resolve this:
https://github.com/delight-im/PHP-Cookie#reading-and-writing-session-data

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

No branches or pull requests

1 participant