����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.169 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/./././www/vendor/laravel/framework/src/Illuminate/Session/ |
Upload File : |
<?php
namespace Illuminate\Session;
use Illuminate\Support\InteractsWithTime;
use SessionHandlerInterface;
class ArraySessionHandler implements SessionHandlerInterface
{
use InteractsWithTime;
/**
* The array of stored values.
*
* @var array
*/
protected $storage = [];
/**
* The number of minutes the session should be valid.
*
* @var int
*/
protected $minutes;
/**
* Create a new array driven handler instance.
*
* @param int $minutes
* @return void
*/
public function __construct($minutes)
{
$this->minutes = $minutes;
}
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function open($savePath, $sessionName)
{
return true;
}
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function close()
{
return true;
}
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function read($sessionId)
{
if (! isset($this->storage[$sessionId])) {
return '';
}
$session = $this->storage[$sessionId];
$expiration = $this->calculateExpiration($this->minutes * 60);
if (isset($session['time']) && $session['time'] >= $expiration) {
return $session['data'];
}
return '';
}
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function write($sessionId, $data)
{
$this->storage[$sessionId] = [
'data' => $data,
'time' => $this->currentTime(),
];
return true;
}
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function destroy($sessionId)
{
if (isset($this->storage[$sessionId])) {
unset($this->storage[$sessionId]);
}
return true;
}
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function gc($lifetime)
{
$expiration = $this->calculateExpiration($lifetime);
foreach ($this->storage as $sessionId => $session) {
if ($session['time'] < $expiration) {
unset($this->storage[$sessionId]);
}
}
return true;
}
/**
* Get the expiration time of the session.
*
* @param int $seconds
* @return int
*/
protected function calculateExpiration($seconds)
{
return $this->currentTime() - $seconds;
}
}