Skip to content

Issue with setting multiple headers #4

@andybee

Description

@andybee

Setting up the layer on a Lambda function requested through ALB seems to only return the first header set within the PHP logic.

<?php
$host = '.' . str_replace('www.', '', $_SERVER['HTTP_HOST']);
setcookie('basketId', '123', time() + 2592000, '/', $host, false, false);
setcookie('basketKey', '456', time() + 2592000, '/', $host, false, false);
echo 'Hello';

Returns:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 5
Content-Type: text/html; charset=UTF-8
Date: Thu, 05 May 2022 11:52:43 GMT
Server: awselb/2.0
Set-Cookie: basketId=123; expires=Sat, 04-Jun-2022 11:52:43 GMT; Max-Age=2592000; path=/; domain=.phptestalb-807238318.eu-west-2.elb.amazonaws.com

Hello

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions