Location: PHPKode > scripts > OO Auth > class_oouth_ex2.php
<?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
															
?>
Return current item: OO Auth