فعال کردن سشن امن

خرید بک لینک

function sec_session_start() {
$session_name = 'sec_session_id'; // Set a custom session name
$secure = true;
// This stops JavaScript being able to access the session id.
$httponly = true;
// Forces sessions to only use cookies.
if (ini_set('session.use_only_cookies', 1) === FALSE) {
header("Location: ../error.php?err=Could not initiate a safe session (ini_set)");
exit();
}
// Gets current cookies params.
$cookieParams = session_get_cookie_params();
session_set_cookie_params($cookieParams["lifetime"],
$cookieParams["path"],
$cookieParams["domain"],
$secure,
$httponly);
// Sets the session name to the one set above.
session_name($session_name);
session_start(); // Start the PHP session
session_regenerate_id(true); // regenerated the session, delete the old one.
}

php مرکز کد های سایت...

ما را در سایت php مرکز کد های سایت دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 179 تاريخ: يکشنبه 10 مرداد 1395 ساعت: 12:33

صفحه بندی