PHP Security - Session Hijacking

Aug 13,2014

Anth Bieb

2014-03-18T18:11:13Z

Brief tutorial on how to prevent session hijacking in PHP. This video is meant for educational purposes only. If anyone would like a sample of the code email me at [email protected]. It is only meant to be used as test code as it does not particularly follow best coding practices.

**This video was accidentally cut short, a major way to also prevent session hijacking is to use SSL encryption / buying an SSL certificate.

Main functions used:
session_start()
session_regenerate_id()
session_destroy() - This was not explained in depth but it is used as part of the logout functionality of the test site created in this video

Resources / Further Reading:
http://php.net/manual/en/session.configuration.php#ini.session.use-strict-mode
http://ca2.php.net/manual/en/function.session-start.php
http://ca2.php.net/manual/en/function.session-regenerate-id.php
http://ca2.php.net/manual/en/function.session-destroy.php

SessionSession HijackingPHP (Programming Language)