今天看了良哥以前一个关于判断是否异地登录的帖子,知道了这个函数记下。。。
session_id():get and /or set the current session id
string
session_id ([
string $id ] )
session_id() id used to get or set the session id for the current session.
the constant SID can also be used to retrieve the current name and session id as a string suitable for adding to URLs.
session_id() 可以取得或者重新配置目前存放的session代号。若无参数 id则表示只有取得目前session的代号。加上参数则表示指定的id。输入及返回均为字符串
输出session_id();
这里会输出在cookie中设置的一个PHPSESSID。
设置session_id()后,原来的会被新设置的取代: