$! 15-APR-1999 MGD refinements $! ??-???-1997 MGD lost in the mists of time $! set verify $! show symbol www_* $ say = "write sys$output" $! $ CookiePath = WWW_SCRIPT_NAME + "/" $! $ if f$type(WWW_HTTP_COOKIE) .NES. "" $ then $! (process a cookie sent from the client) $ Location = f$locate("WASD_COOKIE_DEMO",WWW_HTTP_COOKIE) $ if Location .lt. f$length(WWW_HTTP_COOKIE) $ then $ Cookie = f$extract(Location,999,WWW_HTTP_COOKIE) $ Cookie = f$element(0,";",Cookie) $ Cookie = f$element(1,"=",Cookie) $ CookieCount = f$integer(f$element(0,"_",Cookie)) $ CookieTime = f$element(1,"_",Cookie) + " " + f$element(2,"_",Cookie) $ else $ CookieCount = 0 $ CookieTime = "" $ endif $ else $ CookieCount = 0 $ CookieTime = "" $ endif $! $ if WWW_PATH_INFO .eqs. "/reset" $ then $! (reset the cookie by providing expiry date in the past) $ say "Content-Type: text/html" $ say "Set-Cookie: WASD_COOKIE_DEMO=''Cookie'; path=''CookiePath'; " + - "expires=""Fri, 13-Jan-1978 14:00:00 GMT""" $ say "Expires: Fri, 13-Jan-1978 14:00:00 GMT" $ say "" $ say "" $ say "
" $ say "Use it again straight away!" $ else $ say "You have used this demonstration ''CookieCount' times;" + - " Last at ''CookieTime'" $ say "
The cookie returned was:
''WWW_HTTP_COOKIE'" $ say "
The cookie set this time was:
''COOKIE'" $ say "
The demonstration was produced using " + - "" + - "this very simple DCL CGI script!" $ say "
Reset the cookie" $ say " (IE4 doesn't seem to want to do this!)" $ endif $ say "" $ say ""