konkon1234/laravel-native-session-bridge

session bridge for laravel5 to native php script.
57
Install
composer require konkon1234/laravel-native-session-bridge
Latest Version:v0.1.0
Laravel:5
License:MIT
Last Updated:May 21, 2017
Links: GitHub  ·  Packagist
Maintainer: konkon1234

laravel native session bridge

This library allows for bidirectional reading and writing of the Laravel application of Session management using Mysql Database and the $_SESSION object of Native php.

Support Version

  • php 5.6 or higher
  • Laravel 5.3, 5.4

Usage

set session handler.

example.

$handler = new \Konkon1234\LaravelNativeSessionBridge\LaravelFormatSessionHandlerClient($pdo, $db_name, [
    // Give the same settings as Laravel

    'table' => 'sessions',
    'encrypt' => false,
    'app_key' => null,
    'cipher' => 'AES-256-CBC',
    'cookie' => 'laravel_session',
    'lifetime' => 120,
    'path' => '/',
    'domain' => null,
    'secure' => false,
    'http_only' => true,
]);

ini_set('session.serialize_handler', 'php_serialize'); // require
session_name('laravel_session'); // require
session_set_save_handler($handler, false); // require register_shutdown is false.

session_start();

// You can get the value set in Laravel from $ _SESSION
// $request->session()->put('from_laravel', 'message from laravel');
echo $_SESSION['from_laravel'];

// Once you have set a value for the native session object, you can retrieve it with Laravel
// $request->session()->get('from_native');
$_SESSION['from_native'] = 'message from native';


How to install

composer require konkon1234/laravel-native-session-bridge

Lisence

MIT Lisence

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660

Version History

Version Released Laravel License
v0.1.0 ~5.4 MIT