0
我创建的用户登录系统,并使用此功能我启动会话用户登录系统基于Cookie通过SSL
function sessionStart() {
$session_name = 'sec_session_id'; // Set a custom session name
$secure = false; // Set to true if using https.
$httponly = true; // This stops javascript being able to access the session id.
ini_set('session.use_only_cookies', 1); // Forces sessions to only use cookies.
$cookieParams = session_get_cookie_params(); // Gets current cookies params.
session_set_cookie_params($cookieParams["lifetime"], $cookieParams["path"], $cookieParams["domain"], $secure, $httponly);
session_name($session_name); // Sets the session name to the one set above.
session_start(); // Start the php session
session_regenerate_id(true); // regenerated the session, delete the old one.
}
我使用会话cookie的,就像你可以在我menotioned功能见上我存储在memcached的这个会议提高了我的operation.now我需要创建用户数据存储在it.for例如,我需要的用户ID,然后我存储用户ID的Cookie这样
setcookie('userid','1234',time()+240000)
之后,我需要用户密码和饼干保持用户登录的用户名。但我知道我不应该保持通过如果我们的服务器因为使用memcache而崩溃,我们不会在cookie中保存密码,我们将失去所有用户session.am我对吗?那么我应该如何保持用户登录..只需解释。不需要打扰自己写作码。
在此先感谢