Skip to content

Instantly share code, notes, and snippets.

@geraldvillorente
Created August 23, 2020 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geraldvillorente/e9681d95378c51ccc6104cbe4f34626b to your computer and use it in GitHub Desktop.
Save geraldvillorente/e9681d95378c51ccc6104cbe4f34626b to your computer and use it in GitHub Desktop.
Pantheon session handled by Redis
$settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], true);
ini_set('session.save_handler', 'redis');
ini_set('session.save_path', 'tcp://' . $settings['conf']['redis_client_host'] . ':' . $settings['conf']['redis_client_port'] . '?auth=' . $settings['conf']['redis_client_password']);
session_set_cookie_params(15*60, '/', $_SERVER["HTTP_HOST"], true, true);
session_start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment