Download the PHP package craftsys/laravel-redis-session-enhanced without Composer

On this page you can find all versions of the php package craftsys/laravel-redis-session-enhanced. 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 laravel-redis-session-enhanced

Laravel Redis Session Enhanced Driver

Total Downloads Latest Stable Version License Status

The Laravel's Database Session Driver manages sessions in the Database which associates following attributes (along with the payload) with every session update: user_id, ip_address, user_agent, and last_activty. These attributes can be accessed and modified to provide following capabilities to your customers

But with the Database driver, every request to your application will do a Database update to sessions table to track the latest session information, specifically, the last_activty attribute. This database update is required to validate unauthenticated requests if the session becomes inactive for the configured SESSION_LIFETIME. These session updates on every requests are fast and should not have much performance impact on your request time. But, if you ARE facing performance issues and want to store the session in the redis cache, you can go the Laravel's Redis Session Driver. The redis driver will store and validate the session automatically but you will loose the above mentioned capabilities for your customers (tracking, logouts etc.).

If you want to have similar capabilities as the Database Session driver but want to use Redis for session storage, this project is for you.

Table of Contents

Installation

The packages is available on Packagist and can be installed via Composer by executing following command in shell.

prerequisite

The package is tested for 5.8+,^6.0,^7.0,^8.0,^9.0,^10.0,^11.0 only.

Laravel 5.5+

If you're using Laravel 5.5 or above, the package will automatically register the Craftsys\LaravelRedisSessionEnhanced\RedisSessionEnhancedServiceProvider provider.

Laravel 5.4 and below

Add Craftsys\LaravelRedisSessionEnhanced\RedisSessionEnhancedServiceProvider to the providers array in your config/app.php:

Configuration

The package usage your existing configuration files and requires following modification in configs and env file.

  1. Add a new connection named session in your config/database.php redis configuration

  2. Update the .env file with the session driver and connection

If you have cached your config file, you might want to run php artisan config:clear and php artisan config:cache to revalidate the cache.

Usage

Once you configure, the session data will be automatically stored in Redis cache with automatic validation. The stored session data has following properties in the cache.

If you want to get the underlying handler of the session (RedisSessionEnhancerHandler instance) in your application code, you can use the Illuminate\Support\Facades\Session::getHandler(). Along with the required Session Interface for Custom Drivers by Laravel, this helper provides readAll and destroyAll methods to work with stored sessions. This package also includes a helper to work with sessions.

SessionHelper

To retrieve the stored session data from the cache, you should use the Craftsys\LaravelRedisSessionEnhanced\SessionHelper class. This helper class also handles the SESSION_DRIVER=database driver so that you can easily switch between database and redis drivers as per your application needs, without changing the application code for sessions.

The following helper functions are provided:


All versions of laravel-redis-session-enhanced with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3|^8.0|^8.1
illuminate/support Version ^5.2|^6.0|^7.0|^8.0|^9.0|^10.0|^11.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 craftsys/laravel-redis-session-enhanced contains the following files

Loading the files please wait ....