How to preserve sessionID after browser close?

Viewed 1196

This is my php code.

<?php  
 session_start();
 print_r($_COOKIE);
?>

I got

Array ( [PHPSESSID] => vgojsl5kuuau35kpigsc5mepa3 ) 

When I closed by browser and hit my php file again. I got.

Array ( [PHPSESSID] => r0qaqm2h9o1oj5p70gpgi8k0c7 ) 

I want to save session Id in cookies. So, that when I closed the browser and hit the file again I should get same session id every time on hit, until cookies clear by user.

3 Answers
Related