Is there a way to set a cookie with CGI::Cookie objects, from anrhtml file?

X

Xeno Campanoli

I'm trying this with cgi.out, but it doesn't like me doing that without
a body. There must be a way to print the cookie header from the cookie
object so I can send it out from the top of my .rhtml file, but it
doesn't seem to be obvious how you'd do this.

xc
 
X

Xeno Campanoli

Xeno said:
I'm trying this with cgi.out, but it doesn't like me doing that without
a body. There must be a way to print the cookie header from the cookie
object so I can send it out from the top of my .rhtml file, but it
doesn't seem to be obvious how you'd do this.

xc
 
X

Xeno Campanoli

Xeno Campanoli wrote:
How do I set a cookie from a .rhtml file?
I've got myself a CGI::Cookie object, so I just need to print out the
Set-Cookie header, but there must be an appropriate way to do this in eruby.
When I try cgi.out("cookie" => cookie) it demands a body.
Presumably there is a method in eruby for handling this very very common
case??????
I can see just printing the Set-Cookie: prefix with the output from
cookie.to_s, but how do I know it comes at the right point in the HTTP
header set?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top