fixed typo in security checks for prescription access
[openemr.git] / library / adodb / tests / testsessions.php
blob691aa5f988abab5c87ee90416a98dbe14cdc3d9c
1 <?php
3 /*
4 V4.20 22 Feb 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
5 Released under both BSD license and Lesser GPL library license.
6 Whenever there is any discrepancy between the two licenses,
7 the BSD license will take precedence.
8 Set tabs to 4 for best viewing.
10 Latest version is available at http://php.weblogs.com/
13 function NotifyExpire($ref,$key)
15 print "<p><b>Notify Expiring=$ref, sessionkey=$key</b></p>";
18 //-------------------------------------------------------------------
21 #### CONNECTION
22 $ADODB_SESSION_DRIVER='oci8';
23 $ADODB_SESSION_CONNECT='';
24 $ADODB_SESSION_USER ='scott';
25 $ADODB_SESSION_PWD ='natsoft';
26 $ADODB_SESSION_DB ='';
29 ### TURN DEBUGGING ON
30 $ADODB_SESS_DEBUG = true;
33 #### SETUP NOTIFICATION
34 $USER = 'JLIM'.rand();
35 $ADODB_SESSION_EXPIRE_NOTIFY = array('USER','NotifyExpire');
38 #### INIT
39 ob_start();
40 error_reporting(E_ALL);
41 include('../session/adodb-cryptsession.php');
42 session_start();
45 ### SETUP SESSION VARIABLES
46 $HTTP_SESSION_VARS['MONKEY'] = array('1','abc',44.41);
47 if (!isset($HTTP_GET_VARS['nochange'])) @$HTTP_SESSION_VARS['AVAR'] += 1;
50 ### START DISPLAY
51 print "<h3>PHP ".PHP_VERSION."</h3>";
52 print "<p><b>\$HTTP_SESSION_VARS['AVAR']={$HTTP_SESSION_VARS['AVAR']}</b></p>";
54 print "<hr> <b>Cookies</b>: ";
55 print_r($HTTP_COOKIE_VARS);
57 ### RANDOMLY PERFORM Garbage Collection
58 if (rand() % 10 == 0) {
60 print "<hr><p><b>Garbage Collection</b></p>";
61 adodb_sess_gc(10);
63 print "<p>Random session destroy</p>";
64 session_destroy();