Quantcast
Channel: THOMAS.DEULING.ORG » PHP
Viewing all articles
Browse latest Browse all 10

Validate a PHP Session-ID

$
0
0

If you must work with a PHP Session-ID, sometimes it is better to check if these Session-ID is valid.

/**
 * Checks a Session-ID
 *
 * @author     Thomas Deuling <tdeuling@gmail.com>
 * @param      string $sessionID Session-ID
 * @return     boolean Is valid?!
 */
function checkSessionID($sessionID="") {
	return !preg_match('/^[a-zA-Z0-9]{26}$/', $sessionID);
}

Viewing all articles
Browse latest Browse all 10

Trending Articles