Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

session_create_id

Description

The session_create_id of Session for PHP creates a new session id.

Syntax

session_create_id(
    string $prefix = ""
): string|false

Parameters

prefix

If prefix is specified, new session id is prefixed by prefix. Not all characters are allowed within the session id. Characters in the range a-z A-Z 0-9 , (comma) and - (minus) are allowed.

Return

Returns a new collision free session id for the current session. If it is used without active session, it omits collision check. On failure, false is returned.

Examples

1 · void

<?

$return = session_create_id();

echo $return;

?>
498mshtbluapg3gmlto9ga8mcm

2 · prefix

<?

$prefix = "myprefix";

$return = session_create_id($prefix);

echo $return;

?>
myprefixtje4ot1mlq6jv63phk55deam2s
HomeMenu