123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?php
- namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
- abstract class AbstractProxy
- {
-
- protected $wrapper = false;
-
- protected $saveHandlerName;
-
- public function getSaveHandlerName()
- {
- return $this->saveHandlerName;
- }
-
- public function isSessionHandlerInterface()
- {
- return $this instanceof \SessionHandlerInterface;
- }
-
- public function isWrapper()
- {
- return $this->wrapper;
- }
-
- public function isActive()
- {
- return \PHP_SESSION_ACTIVE === session_status();
- }
-
- public function getId()
- {
- return session_id();
- }
-
- public function setId(string $id)
- {
- if ($this->isActive()) {
- throw new \LogicException('Cannot change the ID of an active session.');
- }
- session_id($id);
- }
-
- public function getName()
- {
- return session_name();
- }
-
- public function setName(string $name)
- {
- if ($this->isActive()) {
- throw new \LogicException('Cannot change the name of an active session.');
- }
- session_name($name);
- }
- }
|