title: How to store and read session (value) in AngularJs?
body: <p>I am having trouble in store and read sessioned data with <code>Angularjs</code> .
  After click on button emp_name should store in <code>session</code> and also how can i read stored emp_name from <code>session</code> .</p>
  
  <p><a href="http://plnkr.co/edit/aX8A6b91obPO4aAr1XAF?p=preview" rel="noreferrer">Sample in plnkr</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Code goes here
  
  var app = angular.module('app', []);
  
  app.controller('Ctrl', function($scope) {
    $scope.employee = [{
        emp_id: 1,
        emp_name: 'Jes',
        emp_cont:9876543445
      }, {
        emp_id: 2,
        emp_name: 'Sandy',
        emp_cont:3553454345
      }, {
        emp_id: 3,
        emp_name: 'Alex',
        emp_cont:9343434345
      }, {
        emp_id: 4,
        emp_name: 'Nancy',
        emp_cont:9876543445
      }, {
        emp_id: 5,
        emp_name: 'Scott',
        emp_cont:9834564455
      }
    ];
    
            $scope.returnRefId = function (emp) {           
              try {
                    //  test emp
                    alert(emp);
                    // session code here
                    
              }
              catch (e) {
                    alert("some errror");
              }
          };
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>ul li{list-style:none;float:left;padding:10px;border:1px solid #ddd;height:20px;width:100px}
  ul{clear:both}
  label{color:red}</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;script data-require="angular.js@*" data-semver="1.3.0-beta.5" src="https://code.angularjs.org/1.3.0-beta.5/angular.js"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" href="style.css" /&gt;
    &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body ng-app="app" ng-controller="Ctrl"&gt;
    &lt;ul ng-repeat="employees in employee | filter:customFilter"&gt;
      &lt;li&gt;{{employees.emp_id}} &lt;/li&gt;
      &lt;li&gt;{{employees.emp_name}} &lt;/li&gt;
      &lt;li&gt;{{employees.emp_cont}} &lt;/li&gt;
      &lt;li&gt;&lt;button   ng-click="returnRefId(employees.emp_name);" &gt;Add Session&lt;/button&gt;&lt;/li&gt;    
    &lt;/ul&gt;
    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
    &lt;label id="read_ses"&gt;How to store and read emp_name thru only session&lt;/label&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have created alert with emp_name on click by using <code>angularjs</code>. I want that on button click emp_name should store in <code>session</code> and for <code>session</code>testing purpose read sessioned emp_name data somewhere on page.</p>
  
  <p>Any and all help/advice is sincerely appreciated.
  Thanks.</p>