Set the session for the script. This function can and should be used to specify the session that the program actions belong to. Before calling this function and specifying the session the program can not access the session variables.
The session ID is usually given by the client program by some means. Typically web browser cookies hold the session identifier.