Skip to content
Snippets Groups Projects
Commit fca6170f authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

It doesn't make any sense to use sessions while invoked from the command line. This resolves #353.

parent 412fde95
No related branches found
No related tags found
No related merge requests found
...@@ -139,6 +139,13 @@ class SimpleSAML_Session ...@@ -139,6 +139,13 @@ class SimpleSAML_Session
{ {
$this->authData = array(); $this->authData = array();
if (php_sapi_name() === 'cli' || defined('STDIN')) {
$this->trackid = 'CL'.bin2hex(openssl_random_pseudo_bytes(4));
SimpleSAML\Logger::setTrackId($this->trackid);
$this->transient = $transient;
return;
}
if ($transient) { // transient session if ($transient) { // transient session
$sh = SimpleSAML_SessionHandler::getSessionHandler(); $sh = SimpleSAML_SessionHandler::getSessionHandler();
$this->trackid = 'TR'.bin2hex(openssl_random_pseudo_bytes(4)); $this->trackid = 'TR'.bin2hex(openssl_random_pseudo_bytes(4));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment