A port of the security class from CodeIgniter 2.2 for Laravel 4.1+