ad_get_cookie

one of the documented procedures in this installation of the ACS
Usage:
ad_get_cookie { -include_set_cookies t } name { default "" }
What it does:
"Returns the value of a cookie, or $default if none exists."
Defined in: /web/philip/packages/acs-core/utilities-procs.tcl

Source code:

arg_parser_for_ad_get_cookie $args

    if { $include_set_cookies == "t" } {
	set headers [ns_conn outputheaders]
	for { set i 0 } { $i < [ns_set size $headers] } { incr i } {
	    if { ![string compare [string tolower [ns_set key $headers $i]] "set-cookie"] &&  [regexp "^$name=(\[^;\]+)" [ns_set value $headers $i] "" "value"] } {
		return $value
	    }
	}
    }

    set headers [ns_conn headers]
    set cookie [ns_set iget $headers Cookie]
    if { [regexp "$name=(\[^;\]+)" $cookie match value] } {
	return $value
    }

    return $default


philg@mit.edu