Thread overview
Does vibe.d support setting cookies?
Feb 01, 2017
aberba
Feb 01, 2017
Daniel Kozák
Feb 01, 2017
Daniel Kozák
Feb 01, 2017
Jack Applegame
February 01, 2017
I can't find it. Like set_cookie() in php.
February 01, 2017
V Wed, 01 Feb 2017 14:09:41 +0000
aberba via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com>
napsáno:

> I can't find it. Like set_cookie() in php.

I am not sure but I use this in one of my projects

    import vibe.http.client;

    auto clientOCX = new RestInterfaceClient!I(host ~ path);
    string sessionId = clientOCX.initialize();
    clientOCX.requestFilter = (HTTPClientRequest req) {
        req.headers.addField("Cookie", "vibe.session_id=" ~ sessionId ~
    "; Path=/; HttpOnly"); };
    return clientOCX;

February 01, 2017
V Wed, 01 Feb 2017 14:09:41 +0000
aberba via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com>
napsáno:

> I can't find it. Like set_cookie() in php.
maybe this http://vibed.org/api/vibe.http.server/HTTPServerResponse.setCookie

February 01, 2017
On Wednesday, 1 February 2017 at 14:09:41 UTC, aberba wrote:
> I can't find it. Like set_cookie() in php.
Yes, it does.

http://vibed.org/api/vibe.http.common/HTTPResponse.cookies