Monday, November 08, 2010 at 12:07 AM.

system.verbs.builtins.webserver.util.parseCookies

on parseCookies (adrParamTable) {
	<<Thursday, November 11, 1999 at 3:06:49 AM by AR
		<<Implemented as a kernel script in Frontier 6.1.
		<<Old code
			<<on parseCookies (adrParamTable)
				<<Script: system.verbs.builtins.webserver.util.parseCookies; Version 1; Date: Thu, 4 June 1998 16:14:51 GMT; ID: RAB
				<<local (adrRequestHeaders, adrCookies)
				<<local (remainder, firstpart, name, value)
				<<
				<<adrRequestHeaders = @adrParamTable^.requestHeaders
				<<
				<<if defined (adrRequestHeaders^.Cookie)
					<<new (tableType, @adrRequestHeaders^.cookies)
					<<adrCookies = @adrRequestHeaders^.cookies
					<<
					<<remainder = adrRequestHeaders^.Cookie
					<<bundle //walk the cookie
						<<loop
							<<if remainder == "" 
								<<break
							<<firstpart = string.nthfield (remainder, ';', 1)
							<<remainder = string.delete (remainder, 1, sizeof (firstpart) + 1)
							<<remainder = string.popLeading (remainder, " ")
							<<name = string.nthfield (firstpart, '=', 1)
							<<value = string.delete (firstpart, 1, sizeof(name) + 1)
							<<adrCookies^.[name] = value
					<<return (true)
				<<else
					<<return (false)
	kernel (webserver.parseCookies)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.