tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich Schoebel <>
Subject Re: cookiecontext
Date Thu, 19 May 2005 20:26:28 GMT
Hi Ronnie,

Am Donnerstag, 19. Mai 2005 16:45 schrieben Sie:
> What version of Tcl are you working with?

> First we should track down the actual problem. If it's really a Tcl
> problem, let them fix it (maybe with our help). If not, than we have a
> problem in Websh and I hope we find a way to fix the cause, not just
> the symptoms ;-)
Curing the symptoms is pretty easy. I'm interested in the cause, too.

> A stripped down version of the relevant code would also help.
See below. When I tried this stripped down version, I noticed, that
it works correctly on the first request (of an interpreter). The symptom
shows up from the second request onwards.(?)
> I know, I know ... I wanted to make sure the Windows build is fixed
> before we release an update, and I would prefer a more stable
> autoconf / configure setup. But it might be that it's better to at
> least have the bugs fixed.
Definitely! And don't forget the "Fehlende-Dateien" ;-)



Now for the code (test.ws3), remember my environment,
LC_TIME not set:

web::cookiecontext mycookie -path / -expires "2 week"

web::initializer {
  # perReqCleanup drops logging configuration after every request
  # we don't want that
  proc web::ap::perReqCleanup {} {}
  # init logging
  web::logdest add *.-debug file -unbuffered /yourpath/ws3.log
  web::logfilter add *.-debug

web::finalizer {
  web::log "shutting down interp"

web::command default {
  web::log ws3.debug "Starting command default"
  mycookie::init dummy
  web::log ws3.debug "Updating cookie"
  set visits [mycookie::cget nvisits 0]
  incr visits
  mycookie::cset nvisits $visits
  mycookie::cset lvisit [clock seconds]
  web::log ws3.debug "Before commit"
  web::log ws3.debug "After commit"
  # redirect response to a variable
  set chan [web::response -select #out]
  web::response -sendheader 0
  # generate a page
  web::log ws3.debug "Generate a page"
  web::put "This is a test page [clock format [clock seconds]]"
  web::log ws3.debug "Page containing 'clock format' done"
  # send the response
  web::response -select $chan
  web::log ws3.debug "Sending page"
  web::put $out
  web::log ws3.debug "done"


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message