我不完全明白它是如何session_start
工作的?例如,这是一个名为 的脚本:
测试器.php
<html>
<body> <head> <title> tester.php </title> </head>
<?php
session_start();
$_SESSION['Mir Taqi Mir'] = "Dekh toh dil ke jaan se uthta hai,yeh dhuan sa kahaan se uthta hai";
?>
<a href='./try.php'>Click to follow</a>
</body>
</html>
和一个名为try.php
:
session_start();
if(isset($_SESSION['Mir Taqi Mir']))
{
echo "Value of the session variable :".$_SESSION['Mir Taqi Mir'];
}
当我跟进时try.php
,tester.php
如何session_start
知道它必须恢复会话而不是开始新会话?
文档说明:session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.
什么标识符?我不明白这个。