Hello Arnaud,


I need a cookie. I know there are very nice sessions. But I really need a cookie. I have a cross-technology web application. It works on cgi (with cgi.tcl), on tclhttpd, on rivet, and I am porting it to websh. As it is such an application, I have my own session environment. And I need to create it again. And I do not catch how cookies are implemented in websh.
You can see the cookie example at http://tcl.apache.org/websh/examples/cookie.html

Basically for setting a cookie in your code would be:

web::cookiecontext fas_context
fas_context::cset $cookie_name $cookie_value
fas_context::commit

Reading a cookie would be:

web::cookiecontext fas_context
set cookie_value [fas_context::cget $cookie_name]
fas_context::commit


Of course, the initialization of the fas_context can be moved to a separate initialization part thus preventing multiple initialization parts.

Also be careful that cookie context need to be committed before any web:puts as it must be sent in the http headers (before sending any part of a page body).

Regards,
Alex

--
Aleksandar Nikov | [EMAIL PROTECTED]
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to