File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/laravel/framework/src/Illuminate/Session
Upload
[..]
ArraySessionHandler.php (2.55 KB)
Edit
Rename
Del
CacheBasedSessionHandler.php (1.88 KB)
Edit
Rename
Del
Console/
Rename
Del
CookieSessionHandler.php (2.86 KB)
Edit
Rename
Del
FileSessionHandler.php (2.5 KB)
Edit
Rename
Del
LICENSE.md (1.05 KB)
Edit
Rename
Del
Middleware/
Rename
Del
SessionManager.php (7.14 KB)
Edit
Rename
Del
Store.php (18.81 KB)
Edit
Rename
Del
SymfonySessionDecorator.php (3.57 KB)
Edit
Rename
Del
TokenMismatchException.php (112 B)
Edit
Rename
Del
composer.json (1.14 KB)
Edit
Rename
Del
Edit: CookieSessionHandler.php
<?php namespace Illuminate\Session; use Illuminate\Contracts\Cookie\QueueingFactory as CookieJar; use Illuminate\Support\InteractsWithTime; use SessionHandlerInterface; use Symfony\Component\HttpFoundation\Request; class CookieSessionHandler implements SessionHandlerInterface { use InteractsWithTime; /** * The cookie jar instance. * * @var \Illuminate\Contracts\Cookie\Factory */ protected $cookie; /** * The request instance. * * @var \Symfony\Component\HttpFoundation\Request */ protected $request; /** * The number of minutes the session should be valid. * * @var int */ protected $minutes; /** * Indicates whether the session should be expired when the browser closes. * * @var bool */ protected $expireOnClose; /** * Create a new cookie driven handler instance. * * @param \Illuminate\Contracts\Cookie\QueueingFactory $cookie * @param int $minutes * @param bool $expireOnClose */ public function __construct(CookieJar $cookie, $minutes, $expireOnClose = false) { $this->cookie = $cookie; $this->minutes = $minutes; $this->expireOnClose = $expireOnClose; } /** * {@inheritdoc} * * @return bool */ public function open($savePath, $sessionName): bool { return true; } /** * {@inheritdoc} * * @return bool */ public function close(): bool { return true; } /** * {@inheritdoc} * * @return string|false */ public function read($sessionId): string|false { $value = $this->request->cookies->get($sessionId) ?: ''; if (! is_null($decoded = json_decode($value, true)) && is_array($decoded) && isset($decoded['expires']) && $this->currentTime() <= $decoded['expires']) { return $decoded['data']; } return ''; } /** * {@inheritdoc} * * @return bool */ public function write($sessionId, $data): bool { $this->cookie->queue($sessionId, json_encode([ 'data' => $data, 'expires' => $this->availableAt($this->minutes * 60), ]), $this->expireOnClose ? 0 : $this->minutes); return true; } /** * {@inheritdoc} * * @return bool */ public function destroy($sessionId): bool { $this->cookie->queue($this->cookie->forget($sessionId)); return true; } /** * {@inheritdoc} * * @return int */ public function gc($lifetime): int { return 0; } /** * Set the request instance. * * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ public function setRequest(Request $request) { $this->request = $request; } }
Simpan