English [ˈseʃn] US [ˈsɛʃən]

n. Meeting, meeting; (court) session; session, semester; (a period of continuous activity)

Plural: sessions

php session_id() function syntax

Function:Get/set the current session ID

Syntax:string session_id ([string $id])

Parameters :

Parameter Description
id If id is specified parameter value, the specified value is used as the session ID. The session_id() function must be called before calling the session_start() function.

Description:session_id() returns the current session ID. If there is no current session, an empty string ("") is returned.

php session_id() function example


Run instance»

Click the "Run instance" button to view the online instance

Output:

string(1) "1"
Run Instance»

Click the "Run Instance" button to view the online instance

Output:

2