session_open.inc
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:1k
- <?php
- /*
- We allow all forms to modify $form_mode and $current_application
- */
- $form_mode_tmp = '';
- $current_application_tmp = '';
- if ( $form_mode != '' ) {
- $form_mode_tmp = $form_mode;
- }
- if ( $current_application != '' ) {
- $current_application_tmp = $current_application;
- }
- $session_db = new Session_Db();
- $session_db = $session_db->Db(
- $default->session_db->driver,
- $default->session_db
- );
- $session = new Session( $session_db );
- /*
- Turn debugging mode on/off for the entire session
- $session->debug->On();
- */
- $session->Add(
- $temp = new SessionElement( 'current_application', 'string' )
- );
- $session->Add(
- $temp = new SessionElement( 'form_mode', 'string' )
- );
- if ( $session_id != '' ) {
- $session->session_id = $session_id;
- $session->Get( $session_id );
- $session->session_id = $session_id;
- } else {
- $session_id = $session->session_id;
- }
- if ( $session_id == '' ) {
- $session_id = $session->CreateSessionId();
- }
- /* These variable can be overriden with user provided variables */
- if ( $form_mode_tmp != '' ) {
- $form_mode = $form_mode_tmp;
- }
- if ( $current_application_tmp != '' ) {
- $current_application = $current_application_tmp;
- }
- ?>