Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Session Laravel Package

zendframework/zend-session

zendframework/zend-session provides robust session management for PHP applications, with configurable storage, session containers, validators, and save handlers. Integrates cleanly with Zend Framework components to secure and organize session data across requests.

View on GitHub
Deep Wiki
Context7

Session Storage

zend-session comes with a standard set of storage handlers. Storage handlers are the intermediary between when the session starts and when the session writes and closes. The default session storage is Zend\Session\Storage\SessionArrayStorage.

Array Storage

Zend\Session\Storage\ArrayStorage provides a facility to store all information in an ArrayObject. This storage method is likely incompatible with 3rd party libraries and all properties will be inaccessible through the $_SESSION superglobal. Additionally ArrayStorage will not automatically repopulate the storage container in the case of each new request and would have to manually be re-populated.

Basic Usage

use Zend\Session\Storage\ArrayStorage;
use Zend\Session\SessionManager;

$populateStorage = ['foo' => 'bar'];
$storage         = new ArrayStorage($populateStorage);
$manager         = new SessionManager();
$manager->setStorage($storage);

Session Storage

Zend\Session\Storage\SessionStorage replaces $_SESSION, providing a facility to store all information in an ArrayObject. This means that it may not be compatible with 3rd party libraries, although information stored in the $_SESSION superglobal should be available in other scopes.

Basic Usage

use Zend\Session\Storage\SessionStorage;
use Zend\Session\SessionManager;

$manager = new SessionManager();
$manager->setStorage(new SessionStorage());

Session Array Storage

Zend\Session\Storage\SessionArrayStorage provides a facility to store all information directly in the $_SESSION superglobal. This storage class provides the most compatibility with 3rd party libraries and allows for directly storing information into $_SESSION.

Basic Usage

use Zend\Session\Storage\SessionArrayStorage;
use Zend\Session\SessionManager;

$manager = new SessionManager();
$manager->setStorage(new SessionArrayStorage());

Custom Storage

To create a custom storage container, you must implement Zend\Session\Storage\StorageInterface. This interface extends each of ArrayAccess, Traversable, Serializable, and Countable, and it is in the methods those define that the majority of implementation occurs. The following methods must also be implemented:

public function getRequestAccessTime() : int;

public function lock(int|string $key = null) : void;
public function isLocked(int|string $key = null) : bool;
public function unlock(int|string $key = null) : void;

public function markImmutable() : void;
public function isImmutable() : bool;

public function setMetadata(string $key, mixed $value, bool $overwriteArray = false) : void;
public function getMetadata(string $key = null) : mixed;

public function clear(inst|string $key = null) : void;

public function fromArray(array $array) : void;
public function toArray(bool $metaData = false) : array;
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport