# Set-Cookie: appearing on page

**URL:** <https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412>\
**Category:** Radiant CMS\
**Created:** [September 29, 2006, 12:16am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412 "2006-09-29T00:16:07Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 29, 2006, 12:16am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/1 "2006-09-29T00:16:07Z")

</div>

I was able to set up a virtual host, using Dyndns’s wildcard capability.

So my site is mostly working (thought I do have it still in development  
mode).

One thing I’m still seeing, in the Admin pages, when I click the Plus  
next to the Articles page (in the default setup), the spinner wheel  
shows for a long time. Then the children appear, but below the last  
child is:

Set-Cookie: \_session\_id=593f6ac8b238a85961a87259f6e59e87; path=/  
Connection: close  
Transfer-Encoding: chunked  
Content-Type: text/html;charset=utf-8

0

Not sure where to look for this. Looks like some weird RJS thing?  
Anyone have an idea?

Thanks!

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 29, 2006, 11:25am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/2 "2006-09-29T11:25:40Z")

</div>

Yeah it might be a weird Ajax thing. You can inspect xmlhttprequests  
easily,  
though: just install Firebug for Firefox, open it up (F12) when you  
enter  
the admin and go to “options” (last option, check it).

When you click on the “plus”-es now you can see the requests in console.  
Inspect the server response by clicking on them.

Your problem doesn’t seem to me like a client-side problem because you  
can  
insert response headers into the page by an accident. It might be a  
server  
problem

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 29, 2006, 11:27am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/3 "2006-09-29T11:27:40Z")

</div>

On 9/29/06, Mislav MarohniÄ? [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Your problem doesn’t seem to me like a client-side problem because you can  
> insert response headers into the page by an accident.

Sorry. Here I meant to say “you CAN’T insert response headers into the  
page  
by an accident”

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 29, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/4 "2006-09-29T14:46:13Z")

</div>

On 9/29/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 9/29/06, Mislav Marohniæ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > On 9/29/06, Mislav Marohniæ \<removed\_email\_address@domain.invalid \> wrote:
> > 
> > > Your problem doesn’t seem to me like a client-side problem because you can insert response headers into the page by an accident.

Hm. Running with Firefox shows the Response Header as:

Date: Fri, 29 Sep 2006 12:51:43 GMT  
Server: Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.1 PHP/5.1.2  
mod\_perl/2.0.2 Perl/v5.8.7  
Cache-Control: no-cache

The tail end of the response shows:

```
  <td class="remove"><a

```

href=“[http://radiant.tsom.homelinux.com/admin/pages/remove/8](http://radiant.tsom.homelinux.com/admin/pages/remove/8)”\> ![remove page](https://www.ruby-forum.com/images/remove.png?1158633174)

```
</tr>

```

Set-Cookie: \_session\_id=eeeb8063fc9e06665dc581dcf9b379af; path=/  
Connection: close  
Transfer-Encoding: chunked  
Content-Type: text/html;charset=utf-8

0

Doing the same with the demo Radiant site shows under Headers:

Date: Fri, 29 Sep 2006 12:40:51 GMT  
Server: lighttpd | wiseheart design  
Content-Type: text/html;charset=utf-8  
Cache-Control: no-cache  
Set-Cookie: \_session\_id=1dfcb2cdcd318b64e88b1ab075b20b5b; path=/  
X-Powered-By: The blood, sweat and tears of the fine, fine TextDrive  
staff  
Served-By: TextDrive  
Vary: Accept-Encoding  
Content-Encoding: gzip  
Content-Length: 526  
Connection: close

So for some reason, half of the headers are not being interpreted as  
headers.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 30, 2006, 9:43pm UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/5 "2006-09-30T21:43:05Z")

</div>

On 9/29/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> So for some reason, half of the headers are not being interpreted as  
> headers.

That’s what I thought. What kind of Apache setup do you have?

It doesn’t look like it originates from Apache… those are the headers  
set  
by the application

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 29, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/6 "2006-09-29T14:38:13Z")

</div>

On 9/29/06, Mislav MarohniÄ? [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 9/29/06, Mislav MarohniÄ? [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Your problem doesn’t seem to me like a client-side problem because you  
> > can insert response headers into the page by an accident.
> 
> Sorry. Here I meant to say “you CAN’T insert response headers into the  
> page by an accident”

It probably is a server problem. When I run via script/server, it runs  
just  
fine.

Now I have to find _that_ Apache setting…

Thanks,

jt

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 30, 2006, 10:39pm UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/7 "2006-09-30T22:39:10Z")

</div>

On 9/30/06, Mislav Marohniæ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 9/29/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > So for some reason, half of the headers are not being interpreted as  
> > headers.
> 
> That’s what I thought. What kind of Apache setup do you have?
> 
> It doesn’t look like it originates from Apache… those are the headers set  
> by the application

It’s Apache 2.0.55, standard setup with Ubuntu Linux.

I even tried loading the URL that’s requested in the Ajax request  
right in the browser, and it shows the partial table and at the  
bottom, the partial headers too.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 1, 2006, 11:30am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/8 "2006-10-01T11:30:32Z")

</div>

On 9/30/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It’s Apache 2.0.55, standard setup with Ubuntu Linux.

Yeah, but that’s now complete info. You power Rails with mod\_ruby, cgi,  
fastcgi, proxying to mongrel?

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 2, 2006, 12:11am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/9 "2006-10-02T00:11:44Z")

</div>

On 10/1/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 10/1/06, Mislav Marohniæ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > On 9/30/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > It’s Apache 2.0.55, standard setup with Ubuntu Linux.
> > 
> > Yeah, but that’s now complete info. You power Rails with mod\_ruby, cgi,  
> > fastcgi, proxying to mongrel?
> 
> Ah, sorry. Apache with fcgid.

Well, I tried switching to cgi (in .htaccess) and I don’t see the  
headers on the page. Switching back to fcgid shows the headers again.  
So, it seems to be something with fcgid then.

Thanks.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 2, 2006, 3:47pm UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/10 "2006-10-02T15:47:02Z")

</div>

When I try loading that specific URL for the children item, as I had  
mentioned, the header items appear at the bottom of the page. The page  
also takes a relativly long time to load too. I’m not sure why it’s  
taking so long (clicking between items is relativly instant -  
expanding the item takes anywhere from 5 to 10 seconds.)

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 2, 2006, 12:03am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/11 "2006-10-02T00:03:43Z")

</div>

On 10/1/06, Mislav Marohniæ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 9/30/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > It’s Apache 2.0.55, standard setup with Ubuntu Linux.
> 
> Yeah, but that’s now complete info. You power Rails with mod\_ruby, cgi,  
> fastcgi, proxying to mongrel?

Ah, sorry. Apache with fcgid.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 3, 2006, 5:04am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/12 "2006-10-03T05:04:33Z")

</div>

On 01-Oct-2006 18:09 -0400, John T. was heard to say:

> Well, I tried switching to cgi (in .htaccess) and I don’t see the  
> headers on the page. Switching back to fcgid shows the headers again.  
> So, it seems to be something with fcgid then.

Try mod\_fastcgi, I have no problem with that and Rails. For me fcgid  
makes  
a lot of trouble in a different non-Rails setup and it would not  
surprise  
me if it’s fcgid that adds those headers at the end of the response.

I personally am in the process of switching all my fastcgi Rails  
instances  
over to Mongrel as it seems to perform a little better and is much  
easier  
to manage in many aspects (suexec, process management, load-balancing,  
etc.).

Cheers,  
Oliver

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 3, 2006, 2:43pm UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/13 "2006-10-03T14:43:38Z")

</div>

On 10/2/06, Oliver B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Try mod\_fastcgi, I have no problem with that and Rails. For me fcgid makes  
> a lot of trouble in a different non-Rails setup and it would not surprise  
> me if it’s fcgid that adds those headers at the end of the response.
> 
> I personally am in the process of switching all my fastcgi Rails instances  
> over to Mongrel as it seems to perform a little better and is much easier  
> to manage in many aspects (suexec, process management, load-balancing,  
> etc.).

I don’t have any problems with fcgid with other Rails apps, just this  
one. Looking at the same page on the Radiant demo site, I see all of  
the headers, but they are properly in the Header of the response. Just  
seems odd why fcgid would pull those items out (and they aren’t  
consecutive either - if they were the last 3 or 4, then maybe, but  
it’s pulling like the second, fourth and fifth header item)

I do have lighttpd installed, but not running on the server. Maybe  
it’s time to figure out how to have this app running on lightty and  
have apache proxy requests to it (grr… I just got Apache to serve up  
the app correctly 😕 )

Thanks

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 2, 2006, 5:15pm UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/14 "2006-10-02T17:15:15Z")

</div>

Bizzare. I don’t know how to help you. It might be anything from Apache  
module quirk to something terribly wrong in Rails internals. Try  
searching  
for your problem on Google, blogs and Rails mailing lists. Try to debug  
those specific views, also.

Check the way Radiant adds response headers and then make a new blank  
app  
and try to set some (any) headers there with the same Rails/Apache  
setup,  
then inspect the output. Recreating the bug helps greatly in identifying  
the  
problem.

-M

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [October 5, 2006, 2:05am UTC](https://www.ruby-forum.com/t/set-cookie-appearing-on-page/70412/15 "2006-10-05T02:05:33Z")

</div>

On 10/3/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 10/2/06, Oliver B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Try mod\_fastcgi, I have no problem with that and Rails. For me fcgid makes  
> > a lot of trouble in a different non-Rails setup and it would not surprise  
> > me if it’s fcgid that adds those headers at the end of the response.

I tried running under Mongrel, and it runs fine. No extra headers.

The odd part is, when (running under Apache/fcgid) clicking the plus  
to expand the item, it takes quite a while to respond. The spinner  
shows for upward of 20 seconds. There isn’t any problem with the  
database (mysql) - everything else runs fine and quick.

Is anyone running radiant under apache with fcgid without problems? I  
tried posting on the Rails mailing list to see if anyone has any  
problems with fcgid / ajax / headers, but as usual I haven’t received  
any responses.

Thanks
