mirror of
https://gitee.com/johng/gf.git
synced 2024-12-05 05:37:55 +08:00
16 lines
335 B
Go
16 lines
335 B
Go
package demo
|
|
|
|
import (
|
|
"gitee.com/johng/gf/g/os/gtime"
|
|
"gitee.com/johng/gf/g/net/ghttp"
|
|
)
|
|
|
|
func init() {
|
|
ghttp.GetServer().BindHandler("/cookie", Cookie)
|
|
}
|
|
|
|
func Cookie(r *ghttp.Request) {
|
|
datetime := r.Cookie.Get("datetime")
|
|
r.Cookie.Set("datetime", gtime.Datetime())
|
|
r.Response.Write("datetime:" + datetime)
|
|
} |