svn path=/trunk/; revision=11
printf '%s\n\n' "Location: $*"
exit 0
}
+
+set_cookie(){
+ case "$1" in
+ session|0) expire='';;
+ ''|default) expire="$(LANG=C date -d "+ 1 week" +'%a, %d %b %Y %T %Z')";;
+ *) expire="$(LANG=C date -d "$1" +'%a, %d %b %Y %T %Z' 2>&-)";;
+ esac
+ cookie="$2"
+
+ printf 'Set-Cookie: %s' "$cookie"
+ [ -n "$expire" ] && printf '; Expires=%s' "$expire"
+ [ $# -ge 3 ] && shift 2 && printf '; %s' "$@"
+ printf '\n'
+}