Aaron, et al., That didn't seem to make any difference. I believe the example I got "dosync" from wanted the whole thing to move forward as a transaction (???). Anyhow, this is what it looks like now:
(defn login-controller [params session] (do (println (params "password") (params "name"))) (dosync (if (= "secret" (params "password")) ; Username can include letters, numbers, ; spaces, underscores, and hyphens. ;(.matches (params :name) "[\\w\\s\\-]+")) (do (assoc (redirect "/page/") :session (assoc session :name (params "name"))) ;{:session (assoc session :name (params "name"))} ;(redirect "/page/")) ) (redirect "/oops/")))) my repl(output) still gets me: "Getting userid: nil" Any thoughts? Thanks, shree On May 11, 10:54 pm, Aaron Cohen <aa...@assonance.org> wrote: > On Wed, May 11, 2011 at 10:27 PM, Shree Mulay <shreemu...@gmail.com> wrote: > > > ;;takes the input params from the login form and stores the > > ;;logged in user into a session. You get logged in when the > > ;;password value is = secret > > (defn login-controller [params session] > > (do (println (params "password") (params "name"))) > > (dosync > > What is this dosync for? > > > (if > > (= "secret" (params "password")) > > ; Username can include letters, numbers, > > ; spaces, underscores, and hyphens. > > ;(.matches (params :name) "[\\w\\s\\-]+")) > > (do > > {:session (assoc session :name (params "name"))} > > This line accomplishes nothing, it creates a map and then throws it away. > > Try returning something like: > (assoc (redirect "/page/") :session (assoc session :name (params "name"))) > > > > > > > > > (redirect "/page/")) > > (redirect "/oops/")))) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en