WriteSafeSessionHandler
class WriteSafeSessionHandler implements SessionHandlerInterface, WriteSafeSessionHandlerInterface (View source)
Wraps the session handler to prevent writes when not necessary or allowed.
Properties
| protected SessionHandlerInterface | $wrappedSessionHandler | ||
| protected bool | $sessionWritable | Whether or not the session is enabled for writing. |
Methods
Constructs a new write safe session handler.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Sets whether or not a session may be written to storage.
Returns whether or not a session may be written to storage.
Details
__construct(SessionHandlerInterface $wrapped_session_handler, bool $session_writable = TRUE)
Constructs a new write safe session handler.
close()
{@inheritdoc}
destroy($session_id)
{@inheritdoc}
gc($max_lifetime)
{@inheritdoc}
open($save_path, $session_id)
{@inheritdoc}
read($session_id)
{@inheritdoc}
write($session_id, $session_data)
{@inheritdoc}
setSessionWritable(bool $flag)
Sets whether or not a session may be written to storage.
It is not possible to enforce writing of the session data. This method is only capable of forcibly disabling that session data is written to storage.
bool
isSessionWritable()
Returns whether or not a session may be written to storage.