# Custom HTTP header

**URL:** <https://www.ruby-forum.com/t/custom-http-header/168283>\
**Category:** Ruby\
**Created:** [May 19, 2009, 5:58am UTC](https://www.ruby-forum.com/t/custom-http-header/168283 "2009-05-19T05:58:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [May 19, 2009, 5:58am UTC](https://www.ruby-forum.com/t/custom-http-header/168283/1 "2009-05-19T05:58:41Z")

</div>

I want a simple http header like the one below.

HTTP/1.1 200 OK  
Server: Mongrel 1.1.5  
Set-Cookie: JSESSIONID=\<session\_key\>; Path=/  
Content-Type: text/html;charset=UTF-8  
Content-Length: 138  
Date: Fri, 15 May 2009 01:48:42 GMT  
Connection: close

I’m using rails 2.2.2. I can’t override the set-cookie part and I also  
want to remove the ETag and X-Runtime parts. I was able to remove the  
Status and Cache-Control parts by using the delete method.

I tried using

cookies[‘JSESSIONID’] = \<sessions\_key\>

but the my\_session cookie is still there.

HTTP/1.1 200 OK  
Connection: close  
Date: Tue, 19 May 2009 02:45:20 GMT  
Set-Cookie: \_my\_session=\<session\_key\>; path=/; HttpOnly  
ETag: “100098631aaee632fb77079e8a6c4932”  
X-Runtime: 260ms  
Content-Type: text/html; charset=utf-8  
Content-Length: 137  
Server: Mongrel 1.1.5

I got the headers above from wireshark. The first header is generated  
by connecting to a java server.

thanks!

---

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [May 19, 2009, 3:47pm UTC](https://www.ruby-forum.com/t/custom-http-header/168283/2 "2009-05-19T15:47:09Z")

</div>

Jim ruther Nill wrote:

> I want a simple http header like the one below.  
> …  
> I’m using rails 2.2.2. I can’t override the set-cookie part and I also  
> want to remove the ETag and X-Runtime parts.

Questions about Rails are best directed to a Rails forum.
