{"id":37878617,"url":"https://github.com/go-http-utils/cookie-session","last_synced_at":"2026-01-16T16:46:48.786Z","repository":{"id":57525701,"uuid":"79296965","full_name":"go-http-utils/cookie-session","owner":"go-http-utils","description":":heavy_check_mark:Use cookie as session, base on secure cookies to encrypt cookie","archived":false,"fork":false,"pushed_at":"2017-11-04T13:53:17.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T16:50:12.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-http-utils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-18T02:54:38.000Z","updated_at":"2024-06-20T16:50:12.145Z","dependencies_parsed_at":"2022-08-28T22:12:47.906Z","dependency_job_id":null,"html_url":"https://github.com/go-http-utils/cookie-session","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/go-http-utils/cookie-session","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http-utils%2Fcookie-session","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http-utils%2Fcookie-session/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http-utils%2Fcookie-session/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http-utils%2Fcookie-session/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-http-utils","download_url":"https://codeload.github.com/go-http-utils/cookie-session/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http-utils%2Fcookie-session/sbom","scorecard":{"id":431964,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-http-utils/cookie-session","commit":"dc2207be818b516ce368cabffd81d3cd92693667"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 3/17 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:35:12.735Z","repository_id":57525701,"created_at":"2025-08-19T03:35:12.735Z","updated_at":"2025-08-19T03:35:12.735Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T16:46:46.260Z","updated_at":"2026-01-16T16:46:48.767Z","avatar_url":"https://github.com/go-http-utils.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cookie-session\n\nUse cookie as session, base on [secure cookie](https://github.com/go-http-utils/cookie) to encrypt cookie, you can also use the another library instead of it.\n\n[![Build Status](https://travis-ci.org/go-http-utils/cookie-session.svg?branch=master)](https://travis-ci.org/go-http-utils/cookie-session)\n[![Coverage Status](http://img.shields.io/coveralls/go-http-utils/cookie-session.svg?style=flat-square)](https://coveralls.io/r/go-http-utils/cookie-session)\n[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/go-http-utils/cookie-session/master/LICENSE)\n[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/go-http-utils/cookie-session)\n\n## Features\n\n* Simple API: use it as an easy way to set signed cookies.\n* Built-in backends to store sessions in cookies.\n* Mechanism to rotate authentication by some custom keys.\n* Multiple sessions per request, even using different backends.\n* Interfaces and infrastructure for custom session backends: sessions from\n  different stores can be retrieved and batch-saved using a common API.\n* User can customize own session with different field that don't require type assertion and cast\n\n## Installation\n\n```go\ngo get github.com/go-http-utils/cookie-session\n```\n\n## Examples\n\n```go\ngo run example/main.go\n```\n\n## Usage\n\n```go\n// Session is custom by user's business\ntype Session struct {\n  *sessions.Meta `json:\"-\"`\n  UserID         string `json:\"userId\"`\n  Name           string `json:\"name\"`\n  Authed         int64  `json:\"authed\"`\n}\n\nfunc (s *Session) Save() error {\n  return s.GetStore().Save(s)\n}\n\nfunc (s *Session) Destroy() error {\n  return s.GetStore().Destroy(s)\n}\n\nfunc main() {\n  SessionName := \"Sess\"\n  SessionKeys := []string{\"keyxxx\"}\n\n  store := sessions.New()\n\n  handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n      session := \u0026Session{Meta: \u0026sessions.Meta{}}\n    store.Load(SessionName, session, cookie.New(w, r, SessionKeys...))\n    if session.UserID == \"\" {\n      session.UserID = \"x\"\n      session.Name = \"y\"\n      session.Authed = 1\n      session.Save()\n    }\n  })\n```\n\n## Other Store Implementations\n\n* https://github.com/mushroomsir/session-redis -Redis\n\n## Other Application Implementations\n\n* https://github.com/teambition/gear-session","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-http-utils%2Fcookie-session","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-http-utils%2Fcookie-session","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-http-utils%2Fcookie-session/lists"}