Timeline for How do I set a cookie using $response->headers->setCookie() in a form submission handler?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 27, 2019 at 4:08 | vote | accept | Delford Chaffin | ||
Mar 27, 2019 at 4:07 | comment | added | Delford Chaffin | Thanks so much for your help! I had been on a page in the Pantheon docs about cookies, but it didn't mention the SESS prefix was needed. What a nightmare that was. | |
Mar 26, 2019 at 20:36 | history | edited | 4uk4 | CC BY-SA 4.0 |
added 19 characters in body
|
Mar 26, 2019 at 20:35 | comment | added | 4uk4 |
In the controller return $response; is all you need to do, don't $response->send(); . I tried to make it more clear in the answer. About the Pantheon/Lando environment, there might be a naming issue for the cookie, see drupal.stackexchange.com/questions/274485/…
|
|
Mar 26, 2019 at 19:05 | comment | added | Delford Chaffin | I moved my cookie setting to a controller method and edited the original question. | |
Mar 26, 2019 at 7:58 | history | edited | 4uk4 | CC BY-SA 4.0 |
added 868 characters in body
|
Mar 25, 2019 at 19:59 | history | answered | 4uk4 | CC BY-SA 4.0 |