Login   Register  
PHP Classes
elePHPant
Icontem

File: sample/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vagharshak Tozalakyan  >  Secure Session  >  sample/index.php  >  Download  
File: sample/index.php
Role: Example script
Content type: text/plain
Description: Sample
Class: Secure Session
Prevent session hijacking or session fixation
Author: By
Last change:
Date: 2005-12-28 12:17
Size: 487 bytes
 

Contents

Class file image Download
<?php
  session_start
();
  require_once 
'../securesession.class.php';
  
$ss = new SecureSession();
  
$ss->check_browser true;
  
$ss->check_ip_blocks 2;
  
$ss->secure_word 'SALT_';
  
$ss->regenerate_id true;
  if (!
$ss->Check() || !isset($_SESSION['logged_in']) || !$_SESSION['logged_in'])
  {
    
header('Location: login.php');
    die();
  }
?>
<html>
<head>
<title>SecureSession Sample</title>
</head>
<body>
You are successfully logged in!
</body>
</html>