Download the PHP package amphp/aerys-session without Composer

On this page you can find all versions of the php package amphp/aerys-session. 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 aerys-session

http-server-session

AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind. This package provides an HTTP server plugin that simplifies session management for your applications. Effortlessly handle user sessions, securely managing data across requests.

Installation

This package can be installed as a Composer dependency.

Usage

Basic usage

To read data from the session is straightforward:

Note that get() will return null if the data in key are not found.

In order to write data, the session must be lock()ed first so that it cannot be written from anywhere else.

Calling commit() will store the data in the session storage and unlock the session.

Other important methods of the Session class are:

Use the middleware to access Session in a RequestHandler

As this package is a plugin for amphp/http-server there is a middleware implementation available that injects the Session instance into the attributes of the Request. When the middleware is used the session is accessible from the attributes:

Note that if the attribute Session::class is not registered then getAttribute will throw a MissingAttributeError.

The middleware will handle setting and reading a session cookie in the request/response as well as releasing all locks on the session after the request has been processed.

If you haven't used middleware in amphp/http-server, follow the instructions on how to use middle ware with amphp/http-server.

A simple example is provided here examples/simple.php.

The SessionMiddleware can be further configured from the constructor regarding four different aspects:

The CookieAttributes is used to configure different cookie properties such as the expiry or the domain:

Using the factory to create an instance of Session

Internally the session works with 3 dependencies:

An instance of the Session can be constructed easily using the provided SessionFactory

This library comes with two storage implementations

and one session ID generator

The constructor of the SessionFactory allows to configure the factory with other implementations, so that subsequent calls to create() will use the new injected implementations. This can be beneficial in the certain scenarios, including testing.

Contributing

Please read our rules for details on our code of conduct, and the process for submitting pull requests to us.

Security

If you discover any security related issues, please use the private security issue reporter instead of using the public issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.


All versions of aerys-session with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
amphp/amp Version ^3
amphp/http Version ^2
amphp/http-server Version ^3
amphp/sync Version ^2
amphp/serialization Version ^1
amphp/cache Version ^2
paragonie/constant_time_encoding Version ^2.2
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 amphp/aerys-session contains the following files

Loading the files please wait ....