Session\Adapter

implements Phalcon\Session\AdapterInterface Source on GitHub Base class for Phalcon\Session adapters Constants integer SESSION_ACTIVE integer SESSION_NONE integer SESSION_DISABLED Methods public __construct ([array $options]) Phalcon\Session\Adapter constructor public start () Starts the session (if headers are already sent the session will not be started) public setOptions (array $options) Sets session’s options $session->setOptions(['uniqueId' => 'my-private-app']); public getOpt

Session\Adapter::getName

public getName () Get session name

Session\Adapter::getId

public getId () Returns active session id echo $session->getId();

Security\Random::hex

public hex ([mixed $len]) Generates a random hex string If $len is not specified, 16 is assumed. It may be larger in future. The length of the result string is usually greater of $len. $random = new \Phalcon\Security\Random(); echo $random->hex(10); // a29f470508d5ccb8e289

Security\Random::base64

public base64 ([mixed $len]) Generates a random base64 string If $len is not specified, 16 is assumed. It may be larger in future. The length of the result string is usually greater of $len. Size formula: 4 *( $len / 3) and this need to be rounded up to a multiple of 4. $random = new \Phalcon\Security\Random(); echo $random->base64(12); // 3rcq39QzGK9fUqh8

Security\Random::base64Safe

public base64Safe ([mixed $len], [mixed $padding]) Generates a random URL-safe base64 string If $len is not specified, 16 is assumed. It may be larger in future. The length of the result string is usually greater of $len. By default, padding is not generated because “=” may be used as a URL delimiter. The result may contain A-Z, a-z, 0-9, “-” and “_”. “=” is also used if $padding is true. See RFC 3548 for the definition of URL-safe base64. $random = new \Phalcon\Security\Random(); echo $rand

Security\Random

Source on GitHub Secure random number generator class. Provides secure random number generator which is suitable for generating session key in HTTP cookies, etc. It supports following secure random number generators: - random_bytes (PHP 7) - libsodium - openssl, libressl - /dev/urandom Phalcon\Security\Random could be mainly useful for: - Key generation (e.g. generation of complicated keys) - Generating random passwords for new user accounts - Encryption systems $random = new \Phalcon\Security\

Security\Random::base58

public base58 ([mixed $n]) Generates a random base58 string If $len is not specified, 16 is assumed. It may be larger in future. The result may contain alphanumeric characters except 0, O, I and l. It is similar to Base64 but has been modified to avoid both non-alphanumeric characters and letters which might look ambiguous when printed. $random = new \Phalcon\Security\Random(); echo $random->base58(); // 4kUgL2pdQMSCQtjE

Security\Random::number

public number (mixed $len) Generates a random number between 0 and $len Returns an integer: 0 <= result <= $len. $random = new \Phalcon\Security\Random(); echo $random->number(16); // 8

Security\Exception

extends class Phalcon\Exception implements Throwable Source on GitHub Methods final private Exception __clone () inherited from Exception Clone the exception public __construct ([string $message], [int $code], [Exception $previous]) inherited from Exception Exception constructor public __wakeup () inherited from Exception ... final public string getMessage () inherited from Exception Gets the Exception message final public int getCode () inherited from Exception Gets the Exception code fin