PHPPM\Utils::generateSessionId PHP Method

generateSessionId() public static method

Generates stronger session ids for session handling.
public static generateSessionId ( ) : string
return string
    public static function generateSessionId()
    {
        $entropy = '';
        $entropy .= uniqid(mt_rand(), true);
        $entropy .= microtime(true);
        if (function_exists('openssl_random_pseudo_bytes')) {
            $entropy .= openssl_random_pseudo_bytes(32, $strong);
        }
        if (function_exists('mcrypt_create_iv')) {
            $entropy .= mcrypt_create_iv(32, MCRYPT_DEV_URANDOM);
        }
        $hash = hash('whirlpool', $entropy);
        return $hash;
    }