scache_getopt

Description

mixed scache_getopt(resource session, long option)
mixed $SCacheConnection->getopt(long option)

scache_getopt queries session's options. Queryable options are :

Parameters

session
Session resource returned from scache_open, scache_reset or scache_connect
option
Currently supported values are SCACHE_OPT_EXPIRES and SCACHE_OPT_KEEPONELIMIT

Return values

Current setting of specified option (that might also be FALSE) or FALSE on error.

In case of failure, error codes resolvable by scache_lasterr is one of below :

Notes

One method of detecting forcibly killed session is to expect some parameter be always found from sessions keyspace. This can be se on session initialization, it might be loginname or it might be just dummy flag like 'i_am_alive', but if it doest not exists on further session connection, client is set to forward user to system error page.

Examples

<?php

/* get connection */
$timeout = 600;
$hostname = false;
$secret = false;
$session = scache_reset('MyEasilyGuessableSecret', $host, $secret, $timeout);

if (scache_getopt($session, SCACHE_OPT_EXPIRES) != $timeout) {
    echo "scache is broken\n";
}
?>