PHP Classes
Icontem

File: class_oouth_ex2.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Heiko Dillemuth  >  OO Auth  >  class_oouth_ex2.php  
File: class_oouth_ex2.php
Role: Example script
Content type: text/plain
Description: Useful example
Class: OO Auth
Manage life time limited sessions securely
 

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
                                                            
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products