original_string: public static function Start($sName, $sSessionDiretory = null){
              $oThis = self::CreateInstanceIfNotExists();
  
              if(!empty($sName)){
                  $sName = md5($sName);
                  
                  if(!is_null($sSessionDiretory)){
                      @session_save_path($sSessionDiretory);
                      Storage::Set("session.path", $sSessionDiretory);
                  }
                  
                  @session_name($sName);
                  $sSessionName = session_name();
  
                  if($sSessionName != $sName)
                      $oThis->sName = $sSessionName;
                  else
                      $oThis->sName = $sName;
                  
                  $bSession = session_start();
  
                  if($bSession){
                      Storage::Set("session.name", $oThis->sName);
                      Storage::Set("session.id", session_id());
  
                      switch($_SERVER["SERVER_ADDR"]){
                          case "127.0.0.1"://Setting to developer mode
                          case "::1":
                              $iTimeout = time()+3600;	
                              session_cache_expire(60); //Increases the cache time of the session to 60 minutes
                              session_cache_limiter("nocache"); //Sets the cache limiter to 'nocache'
                              Storage::Set("session.timeout", $iTimeout); //Setting the timeout session ends
                          break;
                          default:
                              $iTimeout = time()+900;
                              session_cache_expire(15); //Shortens the session cache for 15 minutes
                              session_cache_limiter("private"); //Sets the cache limiter to 'private'
                              Storage::Set("session.timeout", $iTimeout); //Setting the timeout session ends
                          break;
                      }
  
                      //Recording session information
                      Storage::Set("session.cache.limiter", session_cache_limiter());
                      Storage::Set("session.cache.expire", session_cache_expire());
                      Storage::Set("session.cookie.enable", array_key_exists($sName, $_COOKIE));
                     
                      //Verifying authentication information
                      if(array_key_exists($oThis->sName, $_SESSION)){
                          if(array_key_exists("authentication", $_SESSION[$oThis->sName]))
                              $oThis->aAuth = $_SESSION[$oThis->sName]["authentication"];
  
                          if(!empty($oThis->aAuth)){
                              Storage::Set("user.id", $oThis->aAuth["id"]);
                              Storage::Set("user.name", $oThis->aAuth["name"]);
                              Storage::Set("user.username", $oThis->aAuth["username"]);
                              Storage::Set("user.root", $oThis->aAuth["root"]);
                              Storage::Set("session.timeout.login", $oThis->aAuth["timeout"]);
                          }
                      }
                      
                      Storage::Set("session.enabled", true);
                      $oThis->bStarted = true;
                      return true;
                  }
                  else{
                      Storage::Set("session.enabled", false);
                      return false;
                  }
              }
              else{
                  Storage::Set("session.enabled", false);
                  return false;
              }
          }
code: public static function Start($sName, $sSessionDiretory = null){
              $oThis = self::CreateInstanceIfNotExists();
  
              if(!empty($sName)){
                  $sName = md5($sName);
                  
                  if(!is_null($sSessionDiretory)){
                      @session_save_path($sSessionDiretory);
                      Storage::Set("session.path", $sSessionDiretory);
                  }
                  
                  @session_name($sName);
                  $sSessionName = session_name();
  
                  if($sSessionName != $sName)
                      $oThis->sName = $sSessionName;
                  else
                      $oThis->sName = $sName;
                  
                  $bSession = session_start();
  
                  if($bSession){
                      Storage::Set("session.name", $oThis->sName);
                      Storage::Set("session.id", session_id());
  
                      switch($_SERVER["SERVER_ADDR"]){
                          case "127.0.0.1"://Setting to developer mode
                          case "::1":
                              $iTimeout = time()+3600;	
                              session_cache_expire(60); //Increases the cache time of the session to 60 minutes
                              session_cache_limiter("nocache"); //Sets the cache limiter to 'nocache'
                              Storage::Set("session.timeout", $iTimeout); //Setting the timeout session ends
                          break;
                          default:
                              $iTimeout = time()+900;
                              session_cache_expire(15); //Shortens the session cache for 15 minutes
                              session_cache_limiter("private"); //Sets the cache limiter to 'private'
                              Storage::Set("session.timeout", $iTimeout); //Setting the timeout session ends
                          break;
                      }
  
                      //Recording session information
                      Storage::Set("session.cache.limiter", session_cache_limiter());
                      Storage::Set("session.cache.expire", session_cache_expire());
                      Storage::Set("session.cookie.enable", array_key_exists($sName, $_COOKIE));
                     
                      //Verifying authentication information
                      if(array_key_exists($oThis->sName, $_SESSION)){
                          if(array_key_exists("authentication", $_SESSION[$oThis->sName]))
                              $oThis->aAuth = $_SESSION[$oThis->sName]["authentication"];
  
                          if(!empty($oThis->aAuth)){
                              Storage::Set("user.id", $oThis->aAuth["id"]);
                              Storage::Set("user.name", $oThis->aAuth["name"]);
                              Storage::Set("user.username", $oThis->aAuth["username"]);
                              Storage::Set("user.root", $oThis->aAuth["root"]);
                              Storage::Set("session.timeout.login", $oThis->aAuth["timeout"]);
                          }
                      }
                      
                      Storage::Set("session.enabled", true);
                      $oThis->bStarted = true;
                      return true;
                  }
                  else{
                      Storage::Set("session.enabled", false);
                      return false;
                  }
              }
              else{
                  Storage::Set("session.enabled", false);
                  return false;
              }
          }
code_tokens: public static function Start ( $ sName , $ sSessionDiretory = null ) { $ oThis = self :: CreateInstanceIfNotExists ( ) ; if ( ! empty ( $ sName ) ) { $ sName = md5 ( $ sName ) ; if ( ! is_null ( $ sSessionDiretory ) ) { @ session_save_path ( $ sSessionDiretory ) ; Storage :: Set ( "session.path" , $ sSessionDiretory ) ; } @ session_name ( $ sName ) ; $ sSessionName = session_name ( ) ; if ( $ sSessionName != $ sName ) $ oThis -> sName = $ sSessionName ; else $ oThis -> sName = $ sName ; $ bSession = session_start ( ) ; if ( $ bSession ) { Storage :: Set ( "session.name" , $ oThis -> sName ) ; Storage :: Set ( "session.id" , session_id ( ) ) ; switch ( $ _SERVER [ "SERVER_ADDR" ] ) { case "127.0.0.1" : //Setting to developer mode case "::1" : $ iTimeout = time ( ) + 3600 ; session_cache_expire ( 60 ) ; //Increases the cache time of the session to 60 minutes session_cache_limiter ( "nocache" ) ; //Sets the cache limiter to 'nocache' Storage :: Set ( "session.timeout" , $ iTimeout ) ; //Setting the timeout session ends break ; default : $ iTimeout = time ( ) + 900 ; session_cache_expire ( 15 ) ; //Shortens the session cache for 15 minutes session_cache_limiter ( "private" ) ; //Sets the cache limiter to 'private' Storage :: Set ( "session.timeout" , $ iTimeout ) ; //Setting the timeout session ends break ; } //Recording session information Storage :: Set ( "session.cache.limiter" , session_cache_limiter ( ) ) ; Storage :: Set ( "session.cache.expire" , session_cache_expire ( ) ) ; Storage :: Set ( "session.cookie.enable" , array_key_exists ( $ sName , $ _COOKIE ) ) ; //Verifying authentication information if ( array_key_exists ( $ oThis -> sName , $ _SESSION ) ) { if ( array_key_exists ( "authentication" , $ _SESSION [ $ oThis -> sName ] ) ) $ oThis -> aAuth = $ _SESSION [ $ oThis -> sName ] [ "authentication" ] ; if ( ! empty ( $ oThis -> aAuth ) ) { Storage :: Set ( "user.id" , $ oThis -> aAuth [ "id" ] ) ; Storage :: Set ( "user.name" , $ oThis -> aAuth [ "name" ] ) ; Storage :: Set ( "user.username" , $ oThis -> aAuth [ "username" ] ) ; Storage :: Set ( "user.root" , $ oThis -> aAuth [ "root" ] ) ; Storage :: Set ( "session.timeout.login" , $ oThis -> aAuth [ "timeout" ] ) ; } } Storage :: Set ( "session.enabled" , true ) ; $ oThis -> bStarted = true ; return true ; } else { Storage :: Set ( "session.enabled" , false ) ; return false ; } } else { Storage :: Set ( "session.enabled" , false ) ; return false ; } }
docstring: Function to start session
  
  @static
  @access public
  @param string $sName Session name
  @param string $sSessionDiretory Storage directory sessions
  @return boolean
docstring_tokens: Function to start session