Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
/ session Public archive

Wrapper for $_SESSION that can be used with a variety of different session handlers, based on illuminate/session

License

Notifications You must be signed in to change notification settings

userfrosting/session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dfcbace · May 6, 2021

History

53 Commits
Mar 5, 2021
Mar 18, 2020
Dec 4, 2020
Dec 4, 2020
Mar 25, 2019
May 6, 2021
Jan 11, 2019
Dec 23, 2020
Mar 25, 2019
Jan 13, 2019
Dec 4, 2020
Dec 11, 2020

Repository files navigation

Sessions module for UserFrosting 4

Latest Version Software License Join the chat at https://chat.userfrosting.com/channel/support Donate

Branch Build Coverage Style
master
develop  

Example usage:

use Illuminate\Filesystem\Filesystem;
use Illuminate\Session\FileSessionHandler;
use UserFrosting\Session\Session;

// Use custom filesystem sessions
$fs = new FileSystem;
$handler = new FileSessionHandler($fs, \UserFrosting\APP_DIR . "/sessions");

// Creates a new wrapper for $_SESSION
$session = new Session($handler, $config['session']);

// Starts the session
$session->start();

// Set some values
$session['contacts.housekeeper.name']; = 'Alex "the man" Weissman';

// They're stored in array format...
print_r($session->all());

// Output is:
/*
[
    'contacts' => [
        'housekeeper' => [
            'name' => 'Alex "the man" Weissman'
        ]
    ]
];
*/

// Destroy the session, both in memory and on the persistence layer, and tell the browser to remove the cookie
$session->destroy();