Download the PHP package drnasin/mysql-pdo-secure-session-handler without Composer

On this page you can find all versions of the php package drnasin/mysql-pdo-secure-session-handler. 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 mysql-pdo-secure-session-handler

License: MIT

About

This is a mysql pdo secure session handler with openssl encryption/decryption of session data.

Cipher mode used for enryption/decryption is AES-256-CBC.

CBC has an IV and thus needs randomness every time a message is encrypted, changing a part of the message requires re-encrypting everything after the change, transmission errors in one ciphertext block completely destroy the plaintext and change the decryption of the next block, decryption can be parallelized / encryption can't, the plaintext is malleable to a certain degree.

Features

  1. openssl encryption of session data using AES-256-CBC cipher, "encryption key" and initialisation vector("IV")
    • "IV" is needed because of the default cipher mode (CBC)
  2. when session is being created so is the "IV" for that session. "IV "is then stored in the database as binary data
  3. lifetime of a session is kept in the database because
    • can't be tampered with that easily
    • calculation of the sessions expiration can be left to the database (faster) (example: DELETE FROM sessions WHERE (modified + INTERVAL lifetime SECOND) < NOW())

Usage

Generate your encryption key using: openssl rand -base64 -out tests/encryption.key 180 (recommended key length is 128 - 256 bits) then check the included example.

Encryption

As per cipher mode used (CBC in this case) data are encrypted using:\

Database

@see SessionHandler::createTable()

https://github.com/drnasin/mysql-pdo-secure-session-handler/blob/336143844bd89ee88daa2ff20058798f742c83f3/src/Drnasin/Session/SessionHandler.php#L373

Usage

composer require drnasin/mysql-pdo-secure-session-handler

or git clone the repo.

Example

check example.php

If you need any help let me know. Just use the "Issues" tab...

Tests

Update database variables in tests/phpunit.xml, then

run: composer tests

Code coverage

Code coverage will be generated in tests/code-coverage-report directory.


All versions of mysql-pdo-secure-session-handler with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-openssl Version *
ext-pdo Version *
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 drnasin/mysql-pdo-secure-session-handler contains the following files

Loading the files please wait ....