websh does not allow multiple Set-Cookie headers?

View: New views
3 Messages — Rating Filter:   Alert me  

websh does not allow multiple Set-Cookie headers?

by Ashok P. Nadkarni-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A server is allowed to send multiple Set-Cookie headers (one for each
cookie with different expirations etc.) However websh does not seem to
allow this. Using "web::response -set Set-Cookie COOKIEDATA" multiple
times results in only the last call being in effect (i.e. only one
Set-Cookie line with the contents of the last call are sent to the client).

Any way to work around this? If you can point me to the approximate
place to look at modifying this behaviour, I can take a stab.

As an aside, I cannot use cookiecontext type mechanisms as the cookies
set have to be readable by other server-side non-websh components.

Thanks

/Ashok



---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@...
For additional commands, e-mail: websh-user-help@...


Re: websh does not allow multiple Set-Cookie headers?

by Ashok P. Nadkarni-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Never mind, didn't realize you can specify multiple values to
web::response -set to generate multiple header lines for the same key.
/Ashok

Ashok P. Nadkarni wrote:

> A server is allowed to send multiple Set-Cookie headers (one for each
> cookie with different expirations etc.) However websh does not seem to
> allow this. Using "web::response -set Set-Cookie COOKIEDATA" multiple
> times results in only the last call being in effect (i.e. only one
> Set-Cookie line with the contents of the last call are sent to the
> client).
>
> Any way to work around this? If you can point me to the approximate
> place to look at modifying this behaviour, I can take a stab.
>
> As an aside, I cannot use cookiecontext type mechanisms as the cookies
> set have to be readable by other server-side non-websh components.
>
> Thanks
>
> /Ashok
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: websh-user-unsubscribe@...
> For additional commands, e-mail: websh-user-help@...
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@...
For additional commands, e-mail: websh-user-help@...


Re: websh does not allow multiple Set-Cookie headers?

by Ronnie Brunner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Never mind, didn't realize you can specify multiple values to
> web::response -set to generate multiple header lines for the same key.

In addition, you can add multiple cookies (headers) using the
-lappend option:

> websh
% web::response -set Set-Cookie Foo
Foo
% web::response -lappend Set-Cookie Bar
Foo Bar
% web::response -lappend Set-Cookie Zoo
Foo Bar Zoo
% web::put Test
Content-Type: text/html
Set-Cookie: Foo
Set-Cookie: Bar
Set-Cookie: Zoo
Generator: websh 3.6.0b4

Test%

hth
Ronnie
--
Ronnie Brunner | ronnie.brunner@...
phone +41-44-247 79 79 | fax +41-44-247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@...
For additional commands, e-mail: websh-user-help@...