Session can we define as series of interaction between a single client and the web server, which take place over an extended period of time.
Important points of Session :
Session store information on server side. Storing a data on client machine and have to pass it back and forth between the server and client each time, it’s far more practical to keep the data on server, but give a client a ‘key’ to allow it to uniquely identify itself. A key is called a session identifier, it is uniquely associates a client with session. Session identifier also known as the SID (Session ID)
PHP creates its SID whenever we use session_start() or certain other session-related function like session_register(). SID kept in global variable named PHPSESSID.
When we start PHP session, the server assigns it a SID. and variable which we register as session variable are then stored on the server in a cookie-like file. The name of file generally the same as the value of the SID. OR SID would be part of URL
The length of session is determined by the session timeout setting in ‘php.ini’ file. The default is 1,440 seconds (24 min.)
Session is widely use for below mentioned things:
Session use when we want to work with sensitive information.
Session can support store data into $_SESSION super global variable. […]