session_start

int session_start(void) 

Initializes a session.

Returns:

Always returns TRUE

Description:

Initializes a session. If a session ID is sent as a GET or in a cookie and is a valid session identifier, the session is resumed.

Version:

Existing since version 4.0

Example:

Start a session
session_start(); 
if (!$counter) session_register("counter"); 
echo $counter; 
$counter++; 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.