Created
September 25, 2018 07:31
-
-
Save azazqadir/ca8730448663a3f176806ecdcca37a34 to your computer and use it in GitHub Desktop.
Configuring Redis to be used as a PHP session Handler: (https://www.cloudways.com/blog/setup-redis-as-session-handler-php/ )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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