title: sessionStorage is gone when browser is refreshed - Javascript
body: <p>I am trying to keep some data in sessionStorage, but if I refresh the page or leave from a link then come back, the sessionStorage no longer exists.</p>
  
  <p>I am new to sessionStorage, so sorry if this is an obvious fix.</p>
  
  <p>Essentially I store an array into the sessionStorage.</p>
  
  <pre><code>  $scope.addPlant = function(plant) {
      for (i = 0; i &lt; $scope.userPlantList.length; i++) {
        if ($scope.userPlantList[i] === plant) {
          alert("You have already added this plant");
          return;
        }
      }
      $scope.userPlantList.push($scope.currentPlant);
      sessionStorage.setItem("Plants",JSON.stringify($scope.userPlantList));
    };
  </code></pre>
  
  <p>And then when I want to see what is all stored</p>
  
  <pre><code>  $scope.retreiveList = function() {
      var retrieved = sessionStorage.getItem("Plants");
      $scope.userPlantList = JSON.parse(retrieved);
    }
  </code></pre>
  
  <p>And this works fine when I do not refresh the page/app at all.</p>
  
  <p><strong>Question:</strong> How can I get my sessionStorage to last during a refresh/immediate re-visit?</p>