redis-session-php's People
Forkers
costalince enoughbr crodas brothertao skynet oberd kad3nce fahmiardi zhaoyan158567 you-ser wlhgbs2008 zswang dv336699 ruckfull eric-seekas mohamedkdidi yzzshmily csspark compy-ryuredis-session-php's Issues
RedisSession::start() Fatal Error
On PHP 8.1 I am getting issues connecting to redis through RedisSession
start-session.php:
// this must match the express-session `secret` in your Express app
define('EXPRESS_SECRET', 'test');
// this id mutator function helps ensure we look up
// the session using the right id
define('REDIS_SESSION_PREFIX', 'PHPREDIS_SESSION:');
...
require_once("redis-session-php/redis-session.php");
// Test PredisClient connection
$client = new Predis\Client([
"scheme" => "tcp",
"host" => "host.docker.internal",
"port" => 6379,
"password" => "test"
]);
$client->set("foo", "bar");
RedisSession::start([
"scheme" => "tcp",
"host" => "host.docker.internal",
"port" => 6379,
"password" => "test"
]);
$_SESSION["php"] = "Hello from PHP";
if (!isset($_SESSION["cookie"]))
$_SESSION["cookie"] = array();
Looking at redis-cli, the output is:;
127.0.0.1:6379> keys *
1) "foo"
I'm getting the following error when running RedisSession::start():
php-dev | NOTICE: PHP message: PHP Fatal error: Uncaught TypeError: Session callback must have a return value of type bool, null returned in /var/www/php/src/redis-session-php/redis-session.php:47
php-dev | Stack trace:
php-dev | #0 /var/www/php/src/redis-session-php/redis-session.php(47): session_start()
php-dev | #1 /var/www/php/src/start-session.php(55): RedisSession::start()
php-dev | #2 /var/www/public/index.php(4): require_once('/var/www/php/sr...')
php-dev | #3 {main}
php-dev | thrown in /var/www/php/src/redis-session-php/redis-session.php on line 47
Session id does not saved in Redis key
When you create session with RedisSession::start(); it is write to Redis key only prefix. No session id writed. So your session is shared between all users of your service. Problem appeared after this commit: 4b8df2e.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.