1

I have DB session handler and I have a FILE session handler and a REDIS session handler

According to some logic in my bootstrap, I would like to choose which between the two session handlers I'll use for the current request.

How?

The code, before the session_start is

$c= $redis->pconnect('127.0.0.1', 6379);
if(!$c || !$redis->ping()){
  //do logic to switch to files/db session handler
}
Raidri
  • 17,258
  • 9
  • 62
  • 65
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278

0 Answers0