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

Session Laravel Package

joomla/session

Framework-agnostic PHP 8.1+ session management from the Joomla Framework. Provides interfaces and utilities to start and manage sessions, store and retrieve session data, and integrate session handling cleanly within your application.

View on GitHub
Deep Wiki
Context7

Joomla\Session\StorageInterface

The StorageInterface defines an class which represents a data store for session data.

Session Data Interactions

Get the session name

The getName() method is used to read the session name.

/*
 * [@return](https://github.com/return)  string  The session name
 */
public function getName(): string;

Set the session name

The setName() method is used to set the session name. In regular use, the Joomla\Session\Session object will inject the calculated session name into the storage instance.

/*
 * [@param](https://github.com/param)   string  $name  The session name
 *
 * [@return](https://github.com/return)  $this
 */
public function setName(string $name);

Get the session ID

The getId() method is used to read the session ID.

/*
 * [@return](https://github.com/return)  string  The session ID
 */
public function getId(): string;

Set the session ID

The setId() method is used to set the session ID. In regular use, the Joomla\Session\Session object will inject the calculated session ID into the storage instance.

/*
 * [@param](https://github.com/param)   string  $name  The session ID
 *
 * [@return](https://github.com/return)  $this
 */
public function setId(string $name);

Session State Interactions

Check for an active session

The isActive() method is used to check if there is an active session for the current request.

/*
 * [@return](https://github.com/return)  boolean
 */
public function isActive(): bool;

Check if a session has been started

The isStarted() method is used to check if the active session for the current request has been started.

/*
 * [@return](https://github.com/return)  boolean
 */
public function isStarted(): bool;

Start the session

The start() method is used to start a session if it has not already been started.

/**
 * [@return](https://github.com/return)  void
 */
public function start();

Regenerate the session ID

The regenerate() method is used to regenerate the current session ID.

Note, for implementations that interface with PHP's session extension, the session_regenerate_id() function must be called by this method.

/**
 * [@param](https://github.com/param)   boolean  $destroy  Destroy session when regenerating?
 *
 * [@return](https://github.com/return)  boolean  True on success
 */
public function regenerate(bool $destroy = false): bool;

Close the session

The close() method is used to write the data to storage and close the current session.

/**
 * [@return](https://github.com/return)  void
 */
public function close();

Perform session garbage collection

The gc() method is used to trigger the garbage collection process for the backend storage.

/**
 * [@return](https://github.com/return)  integer|boolean  Number of deleted sessions on success or boolean false on failure or if the function is unsupported
 */
public function gc();

Abort the session

The abort() method is used to abort the current session.

/**
 * [@return](https://github.com/return)  boolean
 */
public function abort();

Data Store Interactions

Read from the data store

The get() method is used to read the data for a given key from the data store, returning its current value or the given default value if the requested key was not found.

/*
 * [@param](https://github.com/param)   string  $name     Name of a variable
 * [@param](https://github.com/param)   mixed   $default  Default value of a variable if not set
 *
 * [@return](https://github.com/return)  mixed  Value of a variable
 */
public function get(string $name, $default);

Write to the data store

The set() method is used to write data for a given key to the data store, returning its previous value if one was set.

/*
 * [@param](https://github.com/param)   string  $name   Name of a variable
 * [@param](https://github.com/param)   mixed   $value  Value of a variable
 *
 * [@return](https://github.com/return)  mixed  Old value of a variable
 */
public function set(string $name, $value);

Check if value is defined in data store

The has() method is used to check if a given key has been set in the data store.

/*
 * [@param](https://github.com/param)   string  $name  Name of variable
 *
 * [@return](https://github.com/return)  boolean
 */
public function has(string $name): bool;

Remove key from the data store

The remove() method is used to remove a given key from the data store, returning its current value if set.

/*
 * [@param](https://github.com/param)   string  $name  Name of variable
 *
 * [@return](https://github.com/return)  mixed   The value from session or NULL if not set
 */
public function remove(string $name);

Empty the data store

The clear() method is used to empty the data store.

/*
 * [@return](https://github.com/return)  void
 */
public function clear();

Retrieve all data from the data store

The all() method is used to fetch all data from the data store.

/*
 * [@return](https://github.com/return)  array
 */
public function all(): 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