artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Me want cookie.


From: Nala Ginrut
Subject: Re: Me want cookie.
Date: Sun, 17 Jan 2021 22:40:52 +0800
User-agent: mu4e 1.4.13; emacs 27.1

Mortimer Cladwell writes:

> Thanks Nala,
>
> Looks like :cookies-remove! is now working.
> :cookies-value is not.  When evaluated the cookie name is returned, not the
> value i.e.
> (:cookies-value rc  "prjid") ==> "prjid"

I see.
In the older design of Artanis, users don't have to init #:cookies to
use cookie. But now it's changed, if users don't init #:cookies then
cookie doesn't work correctly.
I've added the check, so if users forget to init #:cookies, then it
throws.

In your case, you just want to use the cookies from the client, then
just init it as `#:cookies #t'.

Please pull the code first.

> I still don't understand the purpose of (:cookies-ref rc 'prjid "prjid")?
> It gives the same results as :cookies-check
> Thanks
> Mortimer

Yes, they have similar result, but in different purpose.

If you just created a cookie in the server-side, and you want to ref it,
you should use :cookies-ref. In this situation, the cookie only exits in
the server-side before you return the response to the client. The client
will not create the cookie before you return from server.

If you want to get cookie sent from the client, you should use
:cookies-value or :cookies-check. In this situation, the cookie exits in
the client and was sent to the server.


--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]