title: PHP Keep SSH session alive/stored
body: <p>I'm using Codeigniter and below is the code that i use to get some info from a device through SSH. The whole process takes about 2.2 seconds to be executed with 2 seconds being the login process. Is there any way i can store or keep the session alive at least for a certain amount of time ??
  The library i'm using for the connection is <code>phpseclib</code></p>
  
  <pre><code>        $time = microtime(true);
          $this-&gt;ssh2-&gt;Net_SSH2('XX.XX.XX.XX');
          if (!$this-&gt;ssh2-&gt;login('XXXX', 'XXXXXXXX')) {
              exit('Login Failed');
          }
          echo (microtime(true) - $time) . ' elapsed';
          $string = $this-&gt;ssh2-&gt;exec('/usr/www/status.cgi');
  </code></pre>