Following code:
$s = @session_start();
logMessage($this->debugLevel, ">>>>>>>>>>>>>>>>" . print_r($s, true));
if ( $s === false )
{
// session not established!
throw new \Exception("Session could not be started");
}
I have configured memcached as session store. Memcache is not running and this generates a notice:
PHP Notice: session_start(): Server xxx (tcp 11211) failed with ...
so far as expected, BUT, $s
is always true
, even if the session obviously can not be started at all.
Q1: what's wrong with this? Q2: how can I catch the error ... ?
EDIT:
This:
if ( session_start() === false )
{
// session not established!
throw new \Exception("Session could not be started");
}
doesn't change anything. Same as above. Exception NOT thrown.
EDIT 2:
memcache (1)
$mc = new MemcachedConf();
session_save_path('' . $mc );
session_module_name("memcache");
memcache (2)
it's a 300 loc class, main part:
if ( $this->memcache == null )
$this->memcache = new Memcache();
return $this->memcache;