# Filtering backend set-cookie

**URL:** <https://www.ruby-forum.com/t/filtering-backend-set-cookie/213242>\
**Category:** NGINX\
**Created:** [October 27, 2011, 1:56pm UTC](https://www.ruby-forum.com/t/filtering-backend-set-cookie/213242 "2011-10-27T13:56:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 27, 2011, 1:56pm UTC](https://www.ruby-forum.com/t/filtering-backend-set-cookie/213242/1 "2011-10-27T13:56:56Z")

</div>

Hi,

Is there a way to filter the cookies set by backend on a caching  
frontend?

What I need is to be able to cache on frontend even if some cookies are  
set.  
If I do proxy\_ignore\_headers: Set-Cookie than all cookies will be  
ignored on  
frontend and page will be cached regardless of what cookie backend sets.

I cannot control the backend, that’s why I need to do it on frontend.

---

<div class="post-metadata">

**Author:** ![Calin\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@Calin\_D](https://www.ruby-forum.com/u/Calin_D)\
**Post date:** [October 27, 2011, 2:19pm UTC](https://www.ruby-forum.com/t/filtering-backend-set-cookie/213242/2 "2011-10-27T14:19:49Z")

</div>

I’ve tried using $upstream\_http\_set\_cookie but it contains only one  
line,  
the first cookie.

So, if the upstream responds with in this order:  
Set-Cookie: some\_cookie=one  
Set-Cookie: another\_cookie=two  
Set-Cookie: third\_cookie=three

$upstream\_http\_set\_cookie will contain ‘some\_cookie=one’
