Wapp

Check-in [b76fa41ae9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When the value of a cookie is an empty string, set its max age to 1 second so that it will be cleared from the browser.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b76fa41ae98896bd1d2f624465cff703e0123ccd750a9f6709a939bd30eef966
User & Date: drh 2018-01-28 17:45:08.862
Context
2018-01-28
19:46
Add a Makefile for MacOS. Add wapp-param. Add the %string(...) substitution for wapp-subst. (check-in: 1b25f9e6ed user: drh tags: trunk)
17:45
When the value of a cookie is an empty string, set its max age to 1 second so that it will be cleared from the browser. (check-in: b76fa41ae9 user: drh tags: trunk)
17:32
Add the wapp-redirect command. (check-in: e6c6f398a0 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to wapp.tcl.
566
567
568
569
570
571
572



573
574

575
576
577
578
579
580
581
    }
  }
  set mimetype [dict get $wapp .mimetype]
  puts $chan "Content-Type: $mimetype\r"
  if {[dict exists $wapp .new-cookies]} {
    foreach {nm val} [dict get $wapp .new-cookies] {
      if {[regexp {^[a-z][-a-z0-9_]*$} $nm]} {



        set val [wappInt-enc-url $val]
        puts $chan "Set-Cookie: $nm=$val; HttpOnly; Path=/\r"

      }
    }
  }
  puts $chan "\r"
  if {[string match text/* $mimetype]} {
    puts $chan [encoding convertto utf-8 [dict get $wapp .reply]]
  } else {







>
>
>
|
|
>







566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
    }
  }
  set mimetype [dict get $wapp .mimetype]
  puts $chan "Content-Type: $mimetype\r"
  if {[dict exists $wapp .new-cookies]} {
    foreach {nm val} [dict get $wapp .new-cookies] {
      if {[regexp {^[a-z][-a-z0-9_]*$} $nm]} {
        if {$val==""} {
          puts $chan "Set-Cookie: $nm=; HttpOnly; Path=/; Max-Age=1\r"
        } else {
          set val [wappInt-enc-url $val]
          puts $chan "Set-Cookie: $nm=$val; HttpOnly; Path=/\r"
        }
      }
    }
  }
  puts $chan "\r"
  if {[string match text/* $mimetype]} {
    puts $chan [encoding convertto utf-8 [dict get $wapp .reply]]
  } else {