Re: Session IP address matching
Hi!
> I'm not aware of a way to override just read().
What would be the problem with it? You can override each method
independently.
> But even even if I could, how would I avoid breaking the rest of the
> SessionHandler? The manual implies that read() is where (in userland PHP
> terms) fopen() + assign file handle + flock() would happen.
Why would you break it? Just do something like:
class SessionHandlerWithIPChecks extends SessionHandler {
public function SessionHandler::read($session_id)
{
$data = parent::read($session_id);
if(!$this->doChecks($data)) {
return "";
}
return $data;
}
}
Then do:
session_set_save_handler(new SessionHandlerWithIPChecks());
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Thread (29 messages)