How can PHP sessions work without relying on cookies?

PHP sessions can work without relying on cookies by using URL parameters to pass the session ID between pages. This can be achieved by setting the session.use_trans_sid directive to true in the php.ini file. This allows PHP to automatically append the session ID to URLs when cookies are not available.

<?php
ini_set('session.use_trans_sid', true);
session_start();
?>