Skip to content

Instantly share code, notes, and snippets.

@azazqadir azazqadir/index.php
Created Sep 25, 2018

Embed
What would you like to do?
Configuring Redis to be used as a PHP session Handler: (https://www.cloudways.com/blog/setup-redis-as-session-handler-php/ )
<?php
ini_set('session.save_handler', 'redis');
ini_set('session.save_path', "tcp://localhost:6379");
//echo ini_get('session.save_path');
session_start();
$count = isset($_SESSION['count']) ? $_SESSION['count'] : 1;
echo $count;
$_SESSION['count'] = ++$count;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.