X

Code Sample Preventing Session Hijacking PHP

आज इस आर्टिकल में हम आपको Code Sample Preventing Session Hijacking PHP के बारे में बताएंगे।

Problem:- Code Sample Preventing Session Hijacking PHP

Solution:-

<?php  

ini_set('session.use_only_cookies', true);
session_start();

$salt = "deep";
$tokenStr = strval(date('W')).$salt;
$token = md5($tokenStr);

if (!isset($_REQUEST['token']) || $_REQUEST['token'] != $token) {
 exit();

}
$_SESSION['token'] = $token;
output_add_rewrite_var('token', $token);


 ?>

Final Words

  • आज इस आर्टिकल में हमने आपको Code Sample Preventing Session Hijacking PHP के बारे में बताया।
  • अगर आपको इससे जुडी कोई अन्य जानकारी चाहए है तो निचे कमेन्ट बॉक्स में कमेन्ट कर के पूछ सकते है।

इसे भी पढ़े –Create A Message Board Using PHP – PHP App