The only reason I'm opting for the cookie solution is that the current
session logic is using ports and there are not an unlimited amount of
ports, I don't like that, furthermore it seems overkill for what I
want to do here where I only want to use the current (app) logic in
the sign up form and the registration form.

What I really want is something like the way it works in PHP+Apache
where the session information is propagated with the help of a php
session id, either through a cookie or the url. I will rework the
current logic which stores the id in the user permanently, when I get
this to work.

The whole process is completely abstracted from the programmer, ie in
the url case one does not have to do anything special as the whole
thing is processed before your script starts (in http.l for instance
in our case)  and the session data is available in the $_SESSION
associative array. The only thing you have to do is to set a flag to
use cookies or not, if not then the url option is used.

And if I remember correctly php_sessid is not available in the $_GET
array either which contains the url variables, hence the abstraction I
mention above, the id can however be retrieved with a global function.

So Alex, how does the url option compare to the cookie solution, is it
equally unpalatable?


On Thu, Apr 2, 2009 at 12:59 PM, Alexander Burger <> wro=
> Hi Tomas and Henrik,
> ok, ok, now as there is such a _huge_ demand for cookies ;-)
> I was always reluctant to include any cookie support at all, as the http
> and form frameworks are designed to work without them, and I privately
> consider cookies a bad design issue.
>> (de cookie @
>> =A0 =A0(let At (rest)
>> =A0 =A0 =A0 (if (assoc (car At) "*Cookies")
>> =A0 =A0 =A0 =A0 =A0(con @ (cdr At))
>> =A0 =A0 =A0 =A0 =A0(push '"*Cookies" At) ) ) )
> I would suggest a slight modification:
> =A0 (de cookie @
> =A0 =A0 =A0(if (assoc (next) "*Cookies")
> =A0 =A0 =A0 =A0 (con @ (rest))
> =A0 =A0 =A0 =A0 (push '"*Cookies" (cons (arg) (rest))) ) )
> This needs one 'cons' less (in the (rest) calculation), but should
> otherwise be equivalent.
>> (de httpCookie (K V P E D S H)
>> =A0 =A0(prin "Set-Cookie: " (ht:Fmt K) "=3D" (ht:Fmt V) "; path=3D" (or =
P "/"))
>> =A0 =A0(when E (prin "; expires=3D" @))
>> =A0 =A0(when D (prin "; domain=3D" @))
>> =A0 =A0(when S (prin "; secure"))
>> =A0 =A0(when H (prin "; HttpOnly"))
>> =A0 =A0(prinl) )
>> (de httpCookies ()
>> =A0 =A0(mapc httpCookie "*Cookies") )
> Are you sure that this works as expected? 'mapc' with a function of
> seven arguments expects seven lists as arguments.
> I would suggest the following:
> =A0 (de httpCookies ()
> =A0 =A0 =A0(mapc
> =A0 =A0 =A0 =A0 '((L)
> =A0 =A0 =A0 =A0 =A0 =A0(prin "Set-Cookie: "
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (ht:Fmt (pop 'L)) "=3D" (ht:Fmt (pop 'L))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 "; path=3D" (or (pop 'L) "/") )
> =A0 =A0 =A0 =A0 =A0 =A0(and (pop 'L) (prin "; expires=3D" @))
> =A0 =A0 =A0 =A0 =A0 =A0(and (pop 'L) (prin "; domain=3D" @))
> =A0 =A0 =A0 =A0 =A0 =A0(and (pop 'L) (prin "; secure"))
> =A0 =A0 =A0 =A0 =A0 =A0(and (pop 'L) (prin "; HttpOnly"))
> =A0 =A0 =A0 =A0 =A0 =A0(prinl) )
> =A0 =A0 =A0 =A0 "*Cookies" ) )
> I have put this into the current testing version.
> Please let me know if it is all right.
> Cheers,
> - Alex
> --

Reply via email to