{"id":31286917,"url":"https://github.com/kohkimakimoto/echo-session","last_synced_at":"2025-09-24T10:58:00.582Z","repository":{"id":315832441,"uuid":"1060492792","full_name":"kohkimakimoto/echo-session","owner":"kohkimakimoto","description":"This is session middleware for Echo, provided as an alternative implementation inspired by labstack/echo-contrib/session.","archived":false,"fork":false,"pushed_at":"2025-09-21T01:48:56.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-21T03:27:19.370Z","etag":null,"topics":["go","golang","labstack-echo"],"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/kohkimakimoto.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-20T02:47:33.000Z","updated_at":"2025-09-21T01:48:33.000Z","dependencies_parsed_at":"2025-09-21T03:27:21.774Z","dependency_job_id":"7822c852-fac6-441f-bc31-71370ce58f51","html_url":"https://github.com/kohkimakimoto/echo-session","commit_stats":null,"previous_names":["kohkimakimoto/echo-session"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kohkimakimoto/echo-session","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohkimakimoto%2Fecho-session","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohkimakimoto%2Fecho-session/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohkimakimoto%2Fecho-session/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohkimakimoto%2Fecho-session/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kohkimakimoto","download_url":"https://codeload.github.com/kohkimakimoto/echo-session/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kohkimakimoto%2Fecho-session/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276737507,"owners_count":25695699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","golang","labstack-echo"],"created_at":"2025-09-24T10:57:58.857Z","updated_at":"2025-09-24T10:58:00.576Z","avatar_url":"https://github.com/kohkimakimoto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Echo Session\n\n[![test](https://github.com/kohkimakimoto/echo-session/actions/workflows/test.yml/badge.svg)](https://github.com/kohkimakimoto/echo-session/actions/workflows/test.yml)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kohkimakimoto/echo-session/blob/master/LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/kohkimakimoto/echo-session.svg)](https://pkg.go.dev/github.com/kohkimakimoto/echo-session)\n\n\nThis is session middleware for [Echo](https://github.com/labstack/echo), provided as an alternative implementation inspired by [labstack/echo-contrib/session](https://github.com/labstack/echo-contrib/tree/master/session).\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\tsession \"github.com/kohkimakimoto/echo-session\"\n\t\"github.com/labstack/echo/v4\"\n)\n\nfunc main() {\n\te := echo.New()\n\n\te.Use(session.Middleware(session.NewCookieStore([]byte(\"12345678901234567890123456789012\"))))\n\n\te.GET(\"/\", func(c echo.Context) error {\n\t\ts := session.MustGet(c)\n\t\tcounter := 0\n\t\tif val := s.Get(\"counter\"); val != nil {\n\t\t\tif count, ok := val.(int); ok {\n\t\t\t\tcounter = count\n\t\t\t}\n\t\t}\n\t\tcounter++\n\n\t\ts.Set(\"counter\", counter)\n\t\tif err := s.Save(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn c.HTML(http.StatusOK, fmt.Sprintf(\"Counter: %d\", counter))\n\t})\n\n\te.GET(\"/refresh\", func(c echo.Context) error {\n\t\ts := session.MustGet(c)\n\t\ts.Clear()\n\t\tif err := s.Save(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn c.Redirect(http.StatusFound, \"/\")\n\t})\n\n\te.Logger.Fatal(e.Start(\":8080\"))\n}\n```\n\n## Author\n\nKohki Makimoto \u003ckohki.makimoto@gmail.com\u003e\n\n## License\n\nThe MIT License (MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkohkimakimoto%2Fecho-session","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkohkimakimoto%2Fecho-session","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkohkimakimoto%2Fecho-session/lists"}