I would like to reduce the likelihood of session hijacking by implementing a cookie based token solution.
The idea is to generate a SHA256 hash based on client related information such as:
PHP
$_SERVER['HTTP_USER_AGENT']
JavaScript:
function gatherUserData(){
return ["time_zone", (new Date()).getTimezoneOffset()/60, "history_length", history.length, "browser_name",
navigator.appName, "browser_engine", navigator.product, "browser_language", navigator.language,
"screen_width", screen.width, "screen_height", screen.height];
}
Whenever the client requests a page, I challenge his/her token by recalculating it.
I believe that it is very unlikely that a hacker would have all this information, and, even if he/she has it, would make it a bit harder.
Would it help preventing session hijacking?
Do you recommend any other techniques?