Session\Adapter::destroy

public destroy ([mixed $removeData]) Destroys the active session var_dump($session->destroy()); var_dump($session->destroy(true));

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

Security\Random::uuid

public uuid () Generates a v4 random UUID (Universally Unique IDentifier) The version 4 UUID is purely random (except the version). It doesn’t contain meaningful information such as MAC address, time, etc. See RFC 4122 for details of UUID. This algorithm sets the version number (4 bits) as well as two reserved bits. All other bits (the remaining 122 bits) are set using a random or pseudorandom data source. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is any hexadec

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\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::bytes

public bytes ([mixed $len]) Generates a random binary string The Random::bytes method returns a string and accepts as input an int representing the length in bytes to be returned. If $len is not specified, 16 is assumed. It may be larger in future. The result may contain any byte: “x00” - “xFF”. $random = new \Phalcon\Security\Random(); $bytes = $random->bytes(); var_dump(bin2hex($bytes)); // possible output: string(32) "00f6c04b144b41fad6a59111c126e1ee"

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::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::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

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\