Explorar el Código

get general cookie value by their name.

master
Patrick Peng Sun hace 8 años
padre
commit
93640f949c
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. +7
    -2
      crmpixel.go

+ 7
- 2
crmpixel.go Ver fichero

@@ -57,8 +57,12 @@ func crmpixelCookie(r *http.Request) (ret http.Cookie) {
}

func getLeadIDFromCookie(r *http.Request) (leadID string, ok bool) {
return cookieVerifyAndGet(r, cookLeadID)
}

func cookieVerifyAndGet(r *http.Request, name string) (value string, ok bool) {
ok = false
cookie, leadok := r.Cookie(cookLeadID) //crm lead
cookie, leadok := r.Cookie(name)
if leadok != nil {
return
}
@@ -73,8 +77,9 @@ func getLeadIDFromCookie(r *http.Request) (leadID string, ok bool) {
return
}
ok = true
leadID = s[0]
value = s[0]
return

}

func createNewCookie(r *http.Request) (ret http.Cookie, info crmdLead) {

Cargando…
Cancelar
Guardar