   session from the driver instance. Returns modified driver."
   [driver]
   (delete-session driver)
-  (swap! driver dissoc :session)
+  (swap! driver dissoc
+         :session :desired-capabilities)
   driver)
 
 (defn stop-driver

  "Connects to a running Webdriver server.

  Creates a new session on Webdriver HTTP server. Sets the session to
  the driver. Returns the modified driver."
  [driver & [opt]]
  (wait-running driver)
  (let [session (create-session driver)]
    (swap! driver assoc :session session)
    driver))

(defn disconnect-driver

  side-effect. All the further requests are made within specific
  session. Some drivers may work with only one active session. Returns
  a long string identifier."
  [driver & [capabilities]]
  (with-resp driver
    :post
    [:session]
    {:desiredCapabilities (or capabilities {})}
    result
    (:sessionId result)))

