docs/examples/Server.php
protected function getBrokerSessionData(string $brokerSessionId)
    {
        /** This is basic example and you should do something better. */

        $cacheFileName = 'broker_session_' . $brokerSessionId;

        if (!file_exists($cacheFileName)) {
            return null;
        }

        if (time() - 3600 > filemtime($cacheFileName)) {
            unlink($cacheFileName);

            return null;
        }

        echo file_get_contents($cacheFileName);
    }
protected function getBrokerSessionData(string $brokerSessionId)
    {
        /** This is basic example and you should do something better. */

        $cacheFileName = 'broker_session_' . $brokerSessionId;

        if (!file_exists($cacheFileName)) {
            return null;
        }

        if (time() - 3600 > filemtime($cacheFileName)) {
            unlink($cacheFileName);

            return null;
        }

        echo file_get_contents($cacheFileName);
    }
protected function getBrokerSessionData ( string $ brokerSessionId ) { /** This is basic example and you should do something better. */ $ cacheFileName = 'broker_session_' . $ brokerSessionId ; if ( ! file_exists ( $ cacheFileName ) ) { return null ; } if ( time ( ) - 3600 > filemtime ( $ cacheFileName ) ) { unlink ( $ cacheFileName ) ; return null ; } echo file_get_contents ( $ cacheFileName ) ; }
Get broker session data from cache.

@param string $brokerSessionId

@return null|string
Get broker session data from cache .