Skip to content

Instantly share code, notes, and snippets.

@gekh
Last active October 25, 2016 12:45
Show Gist options
  • Save gekh/506872627e44bcfd0ed9378f559da90c to your computer and use it in GitHub Desktop.
Save gekh/506872627e44bcfd0ed9378f559da90c to your computer and use it in GitHub Desktop.
Проверка общедоменного хранения PHPSESSID
<?php
ini_set('session.cookie_domain', '.fjru.ru');
$_COOKIE['PHPSESSID'] = 'f789qpc94k5f4qej2h394l89e3'; // допустим получили через API
session_start();
//$_SESSION['gekh_test'] = 'Nisargadatta';
//$_SESSION['gekh_test'] = 'Ramana';
echo "hello gh1";
echo '<hr>';
echo $_SESSION['gekh_test'];
<?php
ini_set('session.cookie_domain', '.fjru.ru');
session_start();
echo "hello gh2";
echo "<br>";
echo $_COOKIE['PHPSESSID']; // допустим отправили через API
// Теория: http://stackoverflow.com/questions/319530/restful-authentication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment