Login   Register  
PHP Classes

File: sample/login.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/login.php  >  Download  
File: sample/login.php
Role: Example script
Content type: text/plain
Description: Sample
Class: Secure Session
Prevent session hijacking or session fixation
Author: By
Last change:
Date: 9 years ago
Size: 982 bytes


Class file image Download
$error '';
  if (isset(
$uname $_POST['uname'];
$passwd $_POST['passwd'];
    if (
$uname == 'User' && $passwd == 'password')
$ss = new SecureSession();
$ss->check_browser true;
$ss->check_ip_blocks 2;
$ss->secure_word 'SALT_';
$ss->regenerate_id true;
$_SESSION['logged_in'] = true;
header('Location: index.php');
$error 'Incorrect username or password.';

<title>SecureSession Sample</title>
if (!empty($error))
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Username: <input type="text" name="uname" />
Password: <input type="password" name="passwd" />
<input type="submit" value="Log In" />