context.go
func ContextRender(cookiesecret string, options ...RenderOptions) Handler {
	return func(w http.ResponseWriter, req *http.Request, c Context) {
		rd := Renderor(w, req, c, options...)

		if rd.Data["RequestStartTime"] != nil {
			rd.Data["RequestTimes"] = time.Since(rd.Data["RequestStartTime"].(time.Time)).Nanoseconds() / 1e6
			rd.Data["RequestStartTime"] = nil //set zero to clean up the RequestStartTime
		}

		ctx := &Cotex{req, map[string]string{}, cookiesecret, w, rd}
		//set some default headers
		tm := time.Now().UTC()

		//ignore errors from ParseForm because it's usually harmless.
		req.ParseForm()
		if len(req.Form) > 0 {
			for k, v := range req.Form {
				ctx.Form[k] = v[0]
			}
		}
		ctx.SetHeader("Date", webTime(tm), true)
		//Set the default content-type
		ctx.SetHeader("Content-Type", "text/html; charset=utf-8", true)

		// set martini context for web.Cotex
		c.Map(rd)
		c.Map(ctx)
		c.Next()
	}
}
func ContextRender(cookiesecret string, options ...RenderOptions) Handler {
	return func(w http.ResponseWriter, req *http.Request, c Context) {
		rd := Renderor(w, req, c, options...)

		if rd.Data["RequestStartTime"] != nil {
			rd.Data["RequestTimes"] = time.Since(rd.Data["RequestStartTime"].(time.Time)).Nanoseconds() / 1e6
			rd.Data["RequestStartTime"] = nil //set zero to clean up the RequestStartTime
		}

		ctx := &Cotex{req, map[string]string{}, cookiesecret, w, rd}
		//set some default headers
		tm := time.Now().UTC()

		//ignore errors from ParseForm because it's usually harmless.
		req.ParseForm()
		if len(req.Form) > 0 {
			for k, v := range req.Form {
				ctx.Form[k] = v[0]
			}
		}
		ctx.SetHeader("Date", webTime(tm), true)
		//Set the default content-type
		ctx.SetHeader("Content-Type", "text/html; charset=utf-8", true)

		// set martini context for web.Cotex
		c.Map(rd)
		c.Map(ctx)
		c.Next()
	}
}
// if cookie secret is set to "", then SetSecureCookie would not work