home
/
zktecojo
/
public_html
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Session
➕ New
📤 Upload
✎ Editing:
FileSessionHandler.php
← Back
<?php namespace Illuminate\Session; use Symfony\Component\Finder\Finder; use Illuminate\Filesystem\Filesystem; class FileSessionHandler implements \SessionHandlerInterface { /** * The filesystem instance. * * @var \Illuminate\Filesystem\Filesystem */ protected $files; /** * The path where sessions should be stored. * * @var string */ protected $path; /** * Create a new file driven handler instance. * * @param \Illuminate\Filesystem\Filesystem $files * @param string $path * @return void */ public function __construct(Filesystem $files, $path) { $this->path = $path; $this->files = $files; } /** * {@inheritDoc} */ public function open($savePath, $sessionName) { return true; } /** * {@inheritDoc} */ public function close() { return true; } /** * {@inheritDoc} */ public function read($sessionId) { if ($this->files->exists($path = $this->path.'/'.$sessionId)) { return $this->files->get($path); } return ''; } /** * {@inheritDoc} */ public function write($sessionId, $data) { $this->files->put($this->path.'/'.$sessionId, $data); } /** * {@inheritDoc} */ public function destroy($sessionId) { $this->files->delete($this->path.'/'.$sessionId); } /** * {@inheritDoc} */ public function gc($lifetime) { $files = Finder::create() ->in($this->path) ->files() ->ignoreDotFiles(true) ->date('<= now - '.$lifetime.' seconds'); foreach ($files as $file) { $this->files->delete($file->getRealPath()); } } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel