PHP Classes

File: Core/CookieExists.php

Recommend this page to a friend!
  Classes of jon   PHP Login Site with Cookie MD5 Hash   Core/CookieExists.php   Download  
File: Core/CookieExists.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Login Site with Cookie MD5 Hash
User login system using cookies with MD5 tokens
Author: By
Last change:
Date: 2 months ago
Size: 447 bytes
 

Contents

Class file image Download
<?php

if (Cookie::Exists(ConfigGlobal::Get('Remember/CookieName')) && !Session::Exists(ConfigGlobal::Get('Session/SessionName'))) {
 
$Hash = Cookie::Get(ConfigGlobal::Get('Remember/CookieName'));
 
$HashCheck = DbGlobal::GetInstance()->get('UsersSession', array('Hash', '=', $Hash));
  if (
$HashCheck->count()) {
   
//echo 'Hash matches, log user in';
   
$User = new User($HashCheck->First()->UserId);
   
$User->Login();
  }
}

?>