title: Yii2 - session_start(): Cannot find save handler 'memcached' - session startup failed
body: <p>I am getting this error:
  <code>session_start(): Cannot find save handler 'memcached' - session startup failed</code></p>
  
  <p>in config/web.php my settings are like this:
  under components</p>
  
  <pre><code>'cache' =&gt; [
            //  'class' =&gt; 'yii\caching\FileCache',
              'class'        =&gt; 'yii\caching\MemCache',
              'useMemcached' =&gt; true,
              'servers' =&gt; [
                  [
                      'host' =&gt; '127.0.0.1',
                      'port' =&gt; 11211
  
                  ],
              ],
  </code></pre>
  
  <p>The phpinfo shows memcache is installed correctly.
  <a href="https://i.stack.imgur.com/5yMT1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5yMT1.png" alt="enter image description here"></a></p>
  
  <p>I also used below script from this link to check if memcache is working</p>
  
  <pre><code>&lt;?php
  if (class_exists('Memcache')) {
      $server = '127.0.0.1';
      if (!empty($_REQUEST['server'])) {
          $server = $_REQUEST['server'];
      }
      $memcache = new Memcache;
      $isMemcacheAvailable = @$memcache-&gt;connect($server);
  
      if ($isMemcacheAvailable) {
          $aData = $memcache-&gt;get('data');
          echo '&lt;pre&gt;';
          if ($aData) {
              echo '&lt;h2&gt;Data from Cache:&lt;/h2&gt;';
              print_r($aData);
          } else {
              $aData = array(
                  'me' =&gt; 'you',
                  'us' =&gt; 'them',
              );
              echo '&lt;h2&gt;Fresh Data:&lt;/h2&gt;';
              print_r($aData);
              $memcache-&gt;set('data', $aData, 0, 300);
          }
          $aData = $memcache-&gt;get('data');
          if ($aData) {
              echo '&lt;h3&gt;Memcache seem to be working fine!&lt;/h3&gt;';
          } else {
              echo '&lt;h3&gt;Memcache DOES NOT seem to be working!&lt;/h3&gt;';
          }
          echo '&lt;/pre&gt;';
      }
  }
  if (!$isMemcacheAvailable) {
      echo 'Memcache not available';
  }
  
  ?&gt;
  </code></pre>
  
  <p>and I am getting the result</p>
  
  <pre><code>Fresh Data:
  Array
  (
      [me] =&gt; you
      [us] =&gt; them
  )
  Memcache seem to be working fine!
  </code></pre>
  
  <p>what I am missing here and how to fix this error.</p>
  
  <p>In top of config/web.php file</p>
  
  <pre><code>use app\cart\storage\SessionStorage;
  Yii::$container-&gt;setSingleton('app\cart\ShoppingCart');
  
  Yii::$container-&gt;set('app\cart\storage\StorageInterface', function() {
      return new SessionStorage(Yii::$app-&gt;session, 'primary-cart');
  });
  </code></pre>