You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
memos/api/utils.go

12 lines
172 B
Go

package api
import (
"net/http"
)
func GetUserIdInCookie(r *http.Request) (string, error) {
userIdCookie, err := r.Cookie("user_id")
return userIdCookie.Value, err
}