PHP Classes
Icontem

File: test_ooauth.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  >  test_ooauth.php  
File: test_ooauth.php
Role: Example script
Content type: text/plain
Description: Example File
Class: OO Auth
Manage life time limited sessions securely
 

Contents

Class file image Download
<?php
######################################################################################
#
# Simple test Script for class: ooauth
#
# (c) Heiko at dillemuth . de, 2004-07-01, 2004-07-20
######################################################################################


include "class_ooauth.php";

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

#Init Session as Projekt: "test_session"
$s=& new ooauth("test_session");
print 
"<body><pre>";

#Print Debugs
#$s->set_debug(true);

#Store Var within Session, test
$s->set_uvar("money""200,--");


#Simple Password/User Test :-)
if($_REQUEST[loginname]=="admin" and $_REQUEST[password]=="password") {

    
#Create new session, Timeout 5 Sek.,
    #and take a look at Server Var $HTTP_HOST
    
print "<br>:new session:".$s->new_session(5"ooauth_remote_addr");
}

#Wait 2 Sek., increase to test the timeout
sleep(2);

#Got Timeout or Error?
if($ooauth->test_session(5)) {

    
header("Location: http://www.phpclasses.org\n\n");  #Redirect if not valid session
    
exit();
}


print 
"<hr>no timeout<p>";
print_r$s->get_uvar("money"));

exit(
0);
?>

 
  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