Login   Register  
PHP Classes
elePHPant
Icontem

File: class_oouth_ex2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Heiko Dillemuth  >  OO Auth  >  class_oouth_ex2.php  >  Download  
File: class_oouth_ex2.php
Role: Example script
Content type: text/plain
Description: Useful example
Class: OO Auth
Manage life time limited sessions securely
Author: By
Last change: Sec. fix in Example
Date: 8 years ago
Size: 993 bytes
 

Contents

Class file image Download
<?php
#################################################
#
# simple example to use the session authentication
#
# (c) 2004 heiko at dillemuth dot de
#
#################################################


#Which var will be tracked?
$ooauth_remote_addr=& $_SERVER['REMOTE_ADDR'];


include 
"class_ooauth.php";

    
$ooauth=& new ooauth("my_test_programname");            #progamname is the prevent session sharing on
                                                            #virtual host servers

    
if($ooauth->test_session(10)) {                            #check session and give more 10 sec. lifetime
        
header("Location: /login.php\n\n"); exit; }                    #if timed out, redirect to this url


#################################################        
# or check         



    
print $ooauth->get_error_msg();                            #print the reasion for destroing the session
        
    
print $ooauth->test_session(0);                            #just print the sessiontime, do not increase time

    
$ooauth->set_error(-2);                                    #destroys the session, reason: password error
                                                            
?>