def make_session_middleware(app, global_conf, session_expiration=NoDefault, expiration=NoDefault, cookie_name=NoDefault, session_file_path=NoDefault, chmod=NoDefault):
 if (session_expiration is NoDefault):
  session_expiration = global_conf.get('session_expiration', (60 * 12))
 session_expiration = int(session_expiration)
 if (expiration is NoDefault):
  expiration = global_conf.get('expiration', (60 * 48))
 expiration = int(expiration)
 if (cookie_name is NoDefault):
  cookie_name = global_conf.get('session_cookie_name', '_SID_')
 if (session_file_path is NoDefault):
  session_file_path = global_conf.get('session_file_path', '/tmp')
 if (chmod is NoDefault):
  chmod = global_conf.get('session_chmod', None)
 return SessionMiddleware(app, session_expiration=session_expiration, expiration=expiration, cookie_name=cookie_name, session_file_path=session_file_path, chmod=chmod)

def make_session_middleware ( app , global_conf , session_expiration = NoDefault , expiration = NoDefault , cookie_name = NoDefault , session_file_path = NoDefault , chmod = NoDefault ) : if ( session_expiration is NoDefault ) : session_expiration = global_conf . get ( 'session_expiration' , ( 60 * 12 ) ) session_expiration = int ( session_expiration ) if ( expiration is NoDefault ) : expiration = global_conf . get ( 'expiration' , ( 60 * 48 ) ) expiration = int ( expiration ) if ( cookie_name is NoDefault ) : cookie_name = global_conf . get ( 'session_cookie_name' , '_SID_' ) if ( session_file_path is NoDefault ) : session_file_path = global_conf . get ( 'session_file_path' , '/tmp' ) if ( chmod is NoDefault ) : chmod = global_conf . get ( 'session_chmod' , None ) return SessionMiddleware ( app , session_expiration = session_expiration , expiration = expiration , cookie_name = cookie_name , session_file_path = session_file_path , chmod = chmod )
wraps the application in a session-managing middleware .