Check if cookies are enabled

JavaScript In JavaScript you simple test for the cookieEnabled property, which is supported in all major browsers. If you deal with an older browser, you can set a cookie and check if it exists. (borrowed from Modernizer): if (navigator.cookieEnabled) return true; // set and read cookie document.cookie = “cookietest=1”; var ret = document.cookie.indexOf(“cookietest=”) != -1; … Read more

PHP Session Fixation / Hijacking

Ok, there are two separate but related problems, and each is handled differently. Session Fixation This is where an attacker explicitly sets the session identifier of a session for a user. Typically in PHP it’s done by giving them a url like http://www.example.com/index…?session_name=sessionid. Once the attacker gives the url to the client, the attack is … Read more