Php Session Work Without Browser Cookies Example

Jun 12, 2021



Php Session Work Without Browser Cookies Example

Hi guys,

Today i will explained how to session work in without Browser Cookies in php . This example is so easy to use in php. THis example to i am increament to the session id in 3 time and then later restart the session start in php.

This exampel to i am only use the session not using to the browser cookies in php.

So let's start to the example.

Example :



ini_set('session.use_cookies', '0');

ini_set('session.use_only_cookies', 0);

ini_set('session.use_trans_sid', 1);



<p><b>Php Session Work Without Browser Cookies Example</b></p>



echo("<p>Session Is Empty</>>\n");

$_SESSION['value'] = 0;

}else if($_SESSION['value'] < 3){

$_SESSION['value'] = $_SESSION['value'] + 1;

echo("<p>Added one \$_SESSION['value']=".$_SESSION['value']."</p>\n");




echo("<p>Session Restarted</p>\n");



<p><a href="nocookies.php">Click This Link</a></p>


<form action="nocookies.php" method="POST">

<input type="submit" name="Click" value="Click Submit Button">


<p>Our Session Id: <?php echo(session_id()); ?></p>





now you can check your own.

i hope it can help you...

#PHP 8