From 5f6a0141f056b28f948184213ebab7645dce5c62 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 8 Jun 2016 11:09:18 +0100 Subject: [PATCH] Add cookie handling to HTTP In and HTTP Response nodes --- nodes/core/io/21-httpin.html | 26 ++++++++++++++++++++++++++ nodes/core/io/21-httpin.js | 26 ++++++++++++++++++++++---- package.json | 1 + 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/nodes/core/io/21-httpin.html b/nodes/core/io/21-httpin.html index f20a1b62d..e6b24a291 100644 --- a/nodes/core/io/21-httpin.html +++ b/nodes/core/io/21-httpin.html @@ -81,7 +81,33 @@
  • statusCode, if set, is used as the response status code (default: 200)
  • headers, if set, should be an object containing field/value pairs to be added as response headers.
  • +
  • cookies, if set, can be used to set or delete cookies. +

    Cookie handling

    +

    The cookies property must be an object of name/value pairs. + The value can be either a string to set the value of the cookie with default + options, or it can be an object of options.

    +

    The following example sets two cookies - one called name with + a value of nick, the other called session with a + value of 1234 and an expiry set to 15 minutes.

    +
    +msg.cookies = {
    +    name: 'nick',
    +    session: {
    +        value: '1234',
    +        maxAge: 900000
    +    }
    +}
    +

    The valid options include:

    + +

    To delete a cookie, set its value to null.

    +