开发者

php renaming session ID

开发者 https://www.devze.com 2022-12-11 22:22 出处:网络
By default the initial PHP session ID is:PHPSESSID However, when I change that to:YourVisit and I click on Cookies, and view Cookie information

By default the initial PHP session ID is:PHPSESSID However, when I change that to:YourVisit and I click on Cookies, and view Cookie information after submitting my form there are two Cookies: PHPSESSID and YourVisit, I thought there was only suppose to be one session ID?

This has been occurring even after hitting Clear Sess开发者_高级运维ion Cookies button and verifying that there are no sessions before submitting the form, just wondering why this is happening (two session ID's), I only need one, disclaimer the values are different and thank you for not flaming the newb.

session_name('YourVisit');
session_start();
<?php
// Take the user's email and store it in a session.
$_SESSION['email'] = $_POST['email'];
// Take the time that the user logged in and store that also in a session.
$_SESSION['loggedin'] = time();
?>


The old PHPSESSID was not removed. but it will be when expired.

If you visit after the change, PHPSESSID will not be set.

0

精彩评论

暂无评论...
验证码 换一张
取 消