diff --git a/dev/js/runner/all.html b/dev/js/runner/all.html
index 48e7353..037d04e 100644
--- a/dev/js/runner/all.html
+++ b/dev/js/runner/all.html
@@ -50,7 +50,8 @@
         'spec/tourSpec',
         'spec/utilSpec',
         'spec/stateSpec',
-        'spec/pipeSpec'
+        'spec/pipeSpec',
+        'spec/sessionSpec'
       ],
       function () {
         window.onload();
diff --git a/dev/js/spec/sessionSpec.js b/dev/js/spec/sessionSpec.js
new file mode 100644
index 0000000..147b512
--- /dev/null
+++ b/dev/js/spec/sessionSpec.js
@@ -0,0 +1,61 @@
+define(['session'], function (sessionClass) {
+
+  beforeEach(
+    function () {
+      document.cookie.split(';').forEach(
+        function (i) {
+          var pair = i.split('=');
+          var name = pair[0].trim().toLowerCase();
+
+        }
+      );
+    }
+  );
+
+  describe('KorAP.Session', function () {  
+    it('should be initializable', function () {
+      let s = sessionClass.create();
+      
+      expect(s).toBeTruthy();
+
+      expect(s.toString().startsWith('korap=')).toBeTruthy();
+
+      s = sessionClass.create('kalamar');
+      
+      expect(s).toBeTruthy();
+
+      expect(s.toString().startsWith('kalamar=')).toBeTruthy();
+    });
+
+    it('should settable and gettable', function () {
+      let s = sessionClass.create('koraptest');
+      s.set("test1", "works");
+
+      expect(s.get("test1")).toEqual("works");
+
+      s.set("test2", "\"wor}ks\"");
+
+      expect(s.get("test1")).toEqual("works");
+      expect(s.get("test2")).toEqual("\"wor}ks\"");
+
+      expect(s.toString().includes("test1")).toBeTruthy();
+      expect(s.toString().includes("test2")).toBeTruthy();
+      expect(s.toString().includes("works")).toBeTruthy();
+      expect(s.toString().includes("%5C%22wor%7Dks%5C%22")).toBeTruthy();
+    });
+
+    it('should write to cookie', function () {
+      let s = sessionClass.create('koraptest');
+      s.clear();     
+      expect(s.toString().includes("koraptest=%7B%7D;")).toBeTruthy();
+      expect(document.cookie.includes("koraptest=")).toBeTruthy();
+      s.set("test3", "works");
+      expect(s.toString().includes("koraptest=%7B%7D;")).toBeFalsy();
+      expect(s.toString().includes("koraptest=%7B%22test3%22%3A%22works%22%7D")).toBeTruthy();
+      expect(document.cookie.includes("koraptest=%7B%22test3%22%3A%22works%22%7D")).toBeTruthy();
+      s.clear();     
+      expect(document.cookie.includes("koraptest=")).toBeTruthy();
+      expect(s.toString()).toEqual("koraptest=%7B%7D;");
+    });   
+  })
+});
diff --git a/dev/js/src/session.js b/dev/js/src/session.js
index 178b83c..92bbadf 100644
--- a/dev/js/src/session.js
+++ b/dev/js/src/session.js
@@ -4,19 +4,23 @@
  *
  * @author Nils Diewald
  */
+
+"use strict";
+
 define({
   /**
    * Create a new session.
    * Expects a name or defaults to 'korap'
    */
   create : function (name = 'korap') {
-    var obj = Object.create(this);
+    const obj = Object.create(this);
     obj._name = name.toLowerCase();
     obj._hash = {};
     obj._parse();
     return obj;
   },
 
+
   /**
    * Get a value based on a key.
    * The value can be complex, as the value is stored as JSON.
@@ -25,6 +29,7 @@
     return this._hash[key.toLowerCase()];
   },
 
+
   /**
    * Set a value based on a key.
    * The value can be complex, as the value is stored as JSON.
@@ -34,37 +39,49 @@
     this._store();
   },
 
+
   /**
    * Clears the session by removing the cookie
    */
   clear : function () {
+    this._hash = {};
     document.cookie = this._name + '=; expires=-1';
   },
 
+
   /* Store cookie */
   _store : function () {
+    document.cookie = this.toString();
+  },
+
+
+  /**
+   * Stringify session cookie.
+   */
+  toString : function () {
     /*
       var date = new Date();
       date.setYear(date.getFullYear() + 1);
     */
-    document.cookie =
-      this._name + '=' + encodeURIComponent(JSON.stringify(this._hash)) + ';';
+    return this._name + '=' + encodeURIComponent(JSON.stringify(this._hash)) + ';';
   },
 
-  /* Parse cookie */
+
+  /**
+   * Parse cookie
+   */
   _parse : function () {
-    var c = document.cookie;
     document.cookie.split(';').forEach(
-      function(i) {
-        var pair = i.split('=');
-        var name = pair[0].trim().toLowerCase();
+      function (i) {
+        const pair = i.split('=');
+        const name = pair[0].trim().toLowerCase();
         if (name === this._name) {
 	        if (pair.length === 1 || pair[1].length === 0)
 	          return;
           this._hash = JSON.parse(decodeURIComponent(pair[1]));
 	        return;
         };
-      }
-    );
+      },
+      this);
   }
 });
