diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 1749e6d..80257e6 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -7,6 +7,7 @@
   'hint/array',
   'vc/array',
   'lib/alertify',
+  'session',
   'api',
   'mailToChiffre',
   'lib/highlight/highlight.pack',
@@ -18,17 +19,18 @@
 	     domReady,
 	     hintArray,
 	     vcArray,
-	     alertifyClass) {
+	     alertifyClass,
+	     sessionClass) {
 
   // Set hint array for hint helper
   KorAP.hintArray = hintArray;
 
   // Localization values
   var loc = KorAP.Locale;
-  loc.VC_allCorpora    = loc.VC_allCorpora  || 'all Corpora';
-  loc.VC_oneCollection = loc.VC_oneCollection  || 'one Collection';
-  loc.TOGGLE_ALIGN = loc.TOGGLE_ALIGN  || 'toggle Alignment';
-  loc.SHOW_KQ = loc.SHOW_KQ  || 'show KoralQuery';
+  loc.VC_allCorpora    = loc.VC_allCorpora    || 'all Corpora';
+  loc.VC_oneCollection = loc.VC_oneCollection || 'one Collection';
+  loc.TOGGLE_ALIGN     = loc.TOGGLE_ALIGN     || 'toggle Alignment';
+  loc.SHOW_KQ          = loc.SHOW_KQ          || 'show KoralQuery';
 
   // Override KorAP.log
   window.alertify = alertifyClass;
@@ -45,6 +47,10 @@
 
   domReady(function (event) {
     var obj = {};
+    var session = sessionClass.create('KalamarJS');
+
+    // What should be visible?
+    var show = session.get('show') || {};
 
     /**
      * Release notifications
@@ -107,37 +113,50 @@
     };
 
     // There is a koralQuery
-    if (KorAP.koralQuery !== undefined && resultButton !== null) {
-      var kq;
-      
-      var toggle = document.createElement('a');
-      toggle.setAttribute('title', loc.SHOW_KQ)
-      toggle.classList.add('show-kq', 'button');
-      toggle.appendChild(document.createElement('span'))
-	.appendChild(document.createTextNode(loc.SHOW_KQ));
-      resultButton.appendChild(toggle);
+    if (KorAP.koralQuery !== undefined) {
 
-      if (toggle !== undefined) {
-      
-	// Show koralquery
-	toggle.addEventListener(
-	  'click', function () {
-	    if (kq === undefined) {
-	      kq = document.createElement('div');
-	      kq.setAttribute('id', 'koralquery');
-	      kq.style.display = 'none';
-	      var kqInner = document.createElement('div');
-	      kq.appendChild(kqInner);
-	      kqInner.innerHTML = JSON.stringify(KorAP.koralQuery, null, '  ');
-	      hljs.highlightBlock(kqInner);
-	      var sb = document.getElementById('search');
-	      sb.insertBefore(kq, sb.firstChild);
-	    };
+      if (resultButton !== null) {
+	var kq;
+      	var toggle = document.createElement('a');
+	toggle.setAttribute('title', loc.SHOW_KQ)
+	toggle.classList.add('show-kq', 'button');
+	toggle.appendChild(document.createElement('span'))
+	  .appendChild(document.createTextNode(loc.SHOW_KQ));
+	resultButton.appendChild(toggle);
 
-	    kq.style.display = (kq.style.display === 'none') ? 'block' : 'none';
+	var showKQ = function () {
+	  if (kq === undefined) {
+	    kq = document.createElement('div');
+	    kq.setAttribute('id', 'koralquery');
+	    kq.style.display = 'none';
+	    var kqInner = document.createElement('div');
+	    kq.appendChild(kqInner);
+	    kqInner.innerHTML = JSON.stringify(KorAP.koralQuery, null, '  ');
+	    hljs.highlightBlock(kqInner);
+	    var sb = document.getElementById('search');
+	    sb.insertBefore(kq, sb.firstChild);
+	  };
+
+	  if (kq.style.display === 'none') {
+	    kq.style.display = 'block';
+	    show['kq'] = true;
 	  }
-	);
+	  else {
+	    kq.style.display = 'none';
+	    delete show['kq'];
+	  };
+	};
+
+	if (toggle !== undefined) {
+      
+	  // Show koralquery
+	  toggle.addEventListener('click', showKQ);
+	};
       };
+
+      // Session has KQ visibility stored
+      if (show["kq"])
+	showKQ.apply();
     };
 
 
@@ -168,16 +187,15 @@
      * Toggle the Virtual Collection builder
      */
     if (vcname) {
-      var collectionShow = document.getElementById('collection-show');
       var vc;
       var vcclick = function () {
 	var view = document.getElementById('vc-view');
 
 	// The vc is visible
-	if (this.classList.contains('active')) {
+	if (vcname.classList.contains('active')) {
 	  view.removeChild(vc.element());
-	  this.classList.remove('active');
-	  delete collectionShow['value'];
+	  vcname.classList.remove('active');
+	  delete show['collection'];
 	}
 
 	// The vc is not visible
@@ -185,12 +203,12 @@
 	  if (vc === undefined)
 	    vc = _getCurrentVC(vcClass, vcArray);
 	  view.appendChild(vc.element());
-	  this.classList.add('active');
-	  collectionShow.value = 'true';
+	  vcname.classList.add('active');
+	  show['collection'] = true;
 	};
       };
       vcname.onclick = vcclick;
-      if (collectionShow.value === 'true') {
+      if (show['collection']) {
 	vcclick.apply();
       };
     };
@@ -201,7 +219,8 @@
      */
     if (document.getElementById('view-tutorial')) {
       window.tutorial = tutClass.create(
-	document.getElementById('view-tutorial')
+	document.getElementById('view-tutorial'),
+	session
       );
       obj.tutorial = window.tutorial;
     }
@@ -225,11 +244,30 @@
     var form = document.getElementById('searchform');
     if (form !== undefined) {
       form.addEventListener('submit', function (e) {
-	if (vc === undefined)
-	  vc = _getCurrentVC(vcClass, vcArray);
+	var qf = document.getElementById('q-field');
 
-	if (vc !== undefined)
+	// No query was defined
+	if (qf.value === undefined || qf.value === '') {
+	  qf.focus();
+	  e.halt();
+	  KorAP.log(700, "No query given");
+	  return;
+	};
+
+	// Store session information
+	session.set("show", show);
+
+	// Set Virtual collection 
+	if (vc === undefined) {
+	  vc = _getCurrentVC(vcClass, vcArray);
+	};
+
+	if (vc !== undefined) {
 	  input.value = vc.toQuery();
+	}
+	else {
+	  delete input['value'];
+	};
       });
     };
 
diff --git a/dev/js/src/tutorial.js b/dev/js/src/tutorial.js
index 55c2415..5009a17 100644
--- a/dev/js/src/tutorial.js
+++ b/dev/js/src/tutorial.js
@@ -17,16 +17,22 @@
      * Create new tutorial object.
      * Accepts an element to bind the tutorial window to.
      */
-    create : function (obj) {
+    create : function (obj,session) {
       if (!obj)
 	return null;
-      return Object.create(this)._init(obj);
+      return Object.create(this)._init(obj,session);
     },
 
     // Initialize Tutorial object
-    _init : function (obj) {
+    _init : function (obj, session) {
 
-      this._session = sessionClass.create();
+      if (session === undefined) {
+	this._session = sessionClass.create();
+      }
+      else {
+	this._session = session;
+      };
+    
 
       if (obj) {
 	this._show = obj;
