会话cookie在设置后会在下一页到期吗?

I have two pages in PHP where the first one creates a cookie using session_set_cookie_params(30 * 60,"/","/",false); and the next page tries to retrieve the cookie (using session_get_cookie_params()) to display the time left on the cookie but for some reason I only get zero time left.

This is the cookie set page

<?php
 session_set_cookie_params(30 * 60,"/","/",false); 
 session_start();   
 $array = session_get_cookie_params();
 echo $array['lifetime'];    
 ?> 

and this is the page that starts the session and retrieves the cookie

<?php
 session_start();   
 $array = session_get_cookie_params();
 echo $array['lifetime']; 
 ?> 

The third parameter you used "/" is not a valid domain name. Using session_set_cookie_params(30 * 60,"/") will work. Default for 4th parameter - secure is false, no need to sepcify.