session_id() function
There is a function session_id() in php which is use to get and/or set the current session id.
string session_id ([ string $id ] )
for getting session id in php we have to use session_id() function without parameter.
echo session_id()
if we want to set session id then we need to pass a parameter inside session_id() function. For this purpose we needs to be called session_id() function before session_start()