Storing the PHP session ID in a form
If you've chosen not to use cookies for PHP sessions, you can append the SID of the session to a URL link in order to keep track of it.
If you want to keep track of SID on page that's accessed by a form submission, the little code snippet below will strip out the PHPSESSID= from the variable for use as a hidden form value:
$sid = substr(SID, (strpos(SID, "=") + 1), strlen(SID));
And then to use it in your form, add the code below somewhere:
<input type="hidden" name="PHPSESSID" value="<?= $sid ?>" />