                         id-token (-> (get (:body at-resp) "id_token") str->jwt)]
                     (if (verify id-token "secret")
                       (do
+                        (assert original-uri (str "Failed to get original-uri from session " (-> this :browser-session :cookie-id)))
+
                         (infof "Verified id_token: %s" id-token)
-                        (assert original-uri (str "Failed to get original-uri from session " app-session-id))
-                        (assoc-session! (:session-store this) app-session-id :access-token access-token)
-
                         (infof "Scope is %s" scope)
-                        (assoc-session! (:session-store this) app-session-id :scope scope)
-
                         (infof "Claims are %s" (:claims id-token))
-                        (assoc-session! (:session-store this) app-session-id :open-id (-> id-token :claims))
+
+
+
+                        (assoc-data! (:browser-session this) req {:access-token access-token :scope scope :open-id (-> id-token :claims) })
+
+
+
                         (redirect original-uri))))))))))
       wrap-params)
 
      ::logout (fn [req]
-                (purge-session! (:session-store this) (get-session-id req APP-SESSION-ID))
+                (remove! (:browser-session this) req)
                 (if location-after-logout
                   (redirect location-after-logout)
                   {:status 200


  AccessTokenGrantee
  (get-access-token [this req]
    (when-let [app-session-id (get-session-id req APP-SESSION-ID)]
      (-> (get-session (:session-store this) app-session-id))))

  (solicit-access-token [this req]
    (solicit-access-token this req []))

   [modular.bidi :refer (WebService)]
   [cylon.oauth.client :refer (AccessTokenGrantee UserIdentity solicit-access-token)]
   [cylon.authorization :refer (RequestAuthorizer)]
   [cylon.session :refer (create-and-attach! get-data exists? ->cookie get-session assoc-session! create-session! cookies-response-with-session get-session-value get-session-id purge-session! remove! assoc-data!)]
   [ring.middleware.cookies :refer (wrap-cookies cookies-request cookies-response)]
   [ring.util.response :refer (redirect)]
   [ring.middleware.params :refer (wrap-params)]
