projectdiscovery/nuclei · error
invalid raw cookie: %s
Error message
invalid raw cookie: %s
What it means
Error "invalid raw cookie: %s" thrown in projectdiscovery/nuclei.
Source
Thrown at pkg/authprovider/authx/file.go:203
// in raw the cookie is in format of
// Set-Cookie: <cookie-name>=<cookie-value>; Expires=<date>; Path=<path>; Domain=<domain_name>; Secure; HttpOnly
func (c *Cookie) Parse() error {
if c.Raw == "" {
return fmt.Errorf("raw cookie cannot be empty")
}
tmp := strings.TrimPrefix(c.Raw, "Set-Cookie: ")
slice := strings.Split(tmp, ";")
if len(slice) == 0 {
return fmt.Errorf("invalid raw cookie no ; found")
}
// first element is the cookie name and value
cookie := strings.Split(slice[0], "=")
if len(cookie) == 2 {
c.Key = cookie[0]
c.Value = cookie[1]
return nil
}
return fmt.Errorf("invalid raw cookie: %s", c.Raw)
}
// GetAuthDataFromFile reads the auth data from file
func GetAuthDataFromFile(file string) (*Authx, error) {
ext := filepath.Ext(file)
if !generic.EqualsAny(ext, ".yml", ".yaml", ".json") {
return nil, fmt.Errorf("invalid file extension: supported extensions are .yml,.yaml and .json got %s", ext)
}
bin, err := os.ReadFile(file)
if err != nil {
return nil, err
}
if ext == ".yml" || ext == ".yaml" {
return GetAuthDataFromYAML(bin)
}
return GetAuthDataFromJSON(bin)
}
View on GitHub (pinned to 265b3a3dec)
When it happens
Trigger: Thrown at pkg/authprovider/authx/file.go:203 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/82ad0943e720699d.
Report an issue: GitHub.