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

Reply via email to