Download the PHP package horde/sessionhandler without Composer

On this page you can find all versions of the php package horde/sessionhandler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sessionhandler

Horde\SessionHandler

Session management with typed objects, capability-detected backends, and no framework opinions.

This library is right for people who like Symfony's rigor, Aura's cleanliness, all my own bugs and PSR-style composability but don't want a framework in their session layer.

Install

Quick start

Or register it as PHP's native handler and keep using $_SESSION:

Architecture

The library is built around three ideas:

Typed value objects. Session IDs are SessionId, not strings that might be empty. Payloads are SerializedSessionPayload, not strings that might be JSON or might be PHP-serialized. Metadata is SessionMetadata with DateTimeImmutable fields, not integer timestamps cast from database columns.

Capability interfaces. A backend declares what it can do through the interfaces it implements. The core asks the type system, not a method that returns true:

Interface What it means
SessionStorageBackend load / save / delete (required)
IterableSessionBackend can list active sessions
SessionMetadataBackend can report created/modified/expires times
AdministrativeSessionBackend can force-expire a session
LockingSessionBackend can acquire/release per-session locks

The orchestrator (SessionHandler) checks instanceof before calling capability methods and throws CapabilityException when the backend does not support the requested operation.

PSR composability. The handler takes an optional PSR-14 EventDispatcherInterface for lifecycle events and a PSR-20 ClockInterface for deterministic time in tests.

Backends

Class Capabilities Requires
FileBackend all five writable directory
SqlBackend storage, iteration, metadata, admin horde/db
HashtableBackend storage, iteration*, admin horde/hashtable
StackBackend storage only two or more backends
ExternalBackend storage only three closures
BuiltinBackend storage only PHP's default handler

*HashtableBackend iteration requires track: true at construction.

Constructors

The Session object

Session is an interface. The default implementation (DefaultSession) is an in-memory key-value store with dirty tracking:

SessionHandler::save() is a no-op when isDirty() returns false.

Events

When an EventDispatcherInterface is provided, the handler dispatches:

Two informational event classes (BackendError, LockFailed) exist for application-level error monitoring.

Extending

Custom backends implement SessionStorageBackend and optionally the capability interfaces they support. Custom serializers implement SessionSerializer. Custom session objects implement Session and come with a matching SessionFactory.

The Horde application framework provides HordeSession (in horde/core, namespace Horde\Core\Session) which extends DefaultSession with scoped key access, authentication metadata via SessionMetaInterface, and transparent per-key encryption via EncryptedValuesInterface. HordeSession stores data in the same two-level $data[$app][$name] structure as PHP's native $_SESSION, so sessions written by the legacy handler are readable without conversion.

A NativePhpSessionSerializer bridges sessions stored through $_SESSION with the object API.

See doc/EXTENDING.md for the full guide.

Upgrading from the legacy Horde_SessionHandler

The lib/ tree ships alongside src/ for backward compatibility. Both autoload paths are active in composer.json. Existing code using Horde_SessionHandler and Horde_SessionHandler_Storage_* continues to work without changes.

New code should use the Horde\SessionHandler namespace. The storage format is wire-compatible for file and SQL backends, but the serialization path differs between the native $_SESSION interface and the explicit object API -- do not mix both for the same session.

See doc/UPGRADING.md for the detailed migration guide.

License

LGPL-2.1-only. See LICENSE.


All versions of sessionhandler with dependencies

PHP Build Version
Package Version
Requires horde/horde-installer-plugin Version dev-FRAMEWORK_6_0 || ^3 || ^2
php Version ^8
horde/exception Version ^3 || dev-FRAMEWORK_6_0
horde/support Version ^3 || dev-FRAMEWORK_6_0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package horde/sessionhandler contains the following files

Loading the files please wait ...