The PHP BUG:The php session handler occur exception uncaught in php script
[email protected] (Szopen Xiao)
| Newsgroups | php.general |
|---|---|
| Message-ID | <CA+BUBRyMebPpKARVeGktyK4oxOZpJi07H+pujcjGg6wxvZj1AA@mail.gmail.com> |
for example, php session handler of user function occur exception, you
can not caught in start session place.
below is code:
<?php
class MySessionHandler implements SessionHandlerInterface
{
// implement interfaces here
public function open( /* paramters */) {
//throw a excetion
throw new Exception();
}
}
try {
$handler = new MySessionHandler();
session_set_save_handler($handler, true);
session_start();
} catch(Exception $e) {
//cant not caught MySessionHandler throw any exception
}