It's been a long time and I've finally had some time to revisit this
code, if I recall correctly I had it kind of working last time with
the *Cookies global as per the instructions in the prior post by Alex,
however when I run the application with the newest pico I get nowhere,
I don't know if something new has been introduced but I've been
following the discussions and I don't think so, but I'm not 100% sure,
hence this post.

This is what the relevant code looks like at the moment:

(de signin ()
         (form NIL
            (<table> NIL NIL NIL
               (<row> NIL "Username"  (gui 'uname '(+TextField) 10))
               (<row> NIL "Password"  (gui 'pwd   '(+PwField)   10))
               (<row> NIL
                  (gui '(+Button) "Login"
                     '(let Uid 1118474715114943738 # (chkLogin (val>
(: home uname)) (val> (: home pwd)))
                         (if Uid
                               (cookie 'uid Uid)
                               (setq *Cookies (cons 'uid Uid))
                               (redirect (pack *Domain "@desktop")))
                            (err "Could not login.")))))
               (<row> NIL (<href> "Sign Up" "@register")))))))

(de testFunc ()
   (prin "cookies: " *Cookies))

As far as I know I should now be able to see the uid by navigating to
*...@testfunc but it only shows me "cookies:" which is also confirmed by
other functions run by @desktop which require that *Cookies is set

What am I missing?


On Mon, Oct 20, 2008 at 7:34 PM, Alexander Burger <> wrote:
> On Mon, Oct 20, 2008 at 11:26:00PM +0700, Henrik Sarvell wrote:
>> Simply manually navigating to http://localhost:8080/@desktop after
>> this displays all the correct results. It seems I can not set the
>> cookie and simply retrieve its contents through the use of *Cookies in
>> the same request?
> The function 'cookie' puts the keys and values into the transient symbol
> "*Cookies" (internal to "lib/http.l"), to be inserted into the next HTTP
> header. The global variable *Cookies, on the other hand, is filled
> during the GET or POST request.
> Do you still need to use cookies internally, once you passed the long
> password id to the other server?
>> Or does the problem have to do with the fact that
>> I'm redirecting from a forked process since the sign in form is using
>> the GUI stuff?
> This should not matter. The redirection simply sends a page to the
> browser that tells him another address.
> Cheers,
> - Alex
> --

Reply via email to