{"id":18553900,"url":"https://github.com/libi/gin-session","last_synced_at":"2025-10-07T14:51:22.386Z","repository":{"id":94400241,"uuid":"46479930","full_name":"libi/gin-session","owner":"libi","description":"go gin框架的session中间件， 目前只实现了redis驱动","archived":false,"fork":false,"pushed_at":"2015-11-19T09:34:18.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T11:50:38.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-19T08:54:15.000Z","updated_at":"2018-04-16T18:51:05.000Z","dependencies_parsed_at":"2023-03-11T01:15:20.869Z","dependency_job_id":null,"html_url":"https://github.com/libi/gin-session","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/libi/gin-session","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fgin-session","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fgin-session/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fgin-session/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fgin-session/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libi","download_url":"https://codeload.github.com/libi/gin-session/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fgin-session/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278794400,"owners_count":26046968,"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-10-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2024-11-06T21:18:48.271Z","updated_at":"2025-10-07T14:51:22.369Z","avatar_url":"https://github.com/libi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gin-session\ngo gin框架的session中间件， 目前只实现了redis驱动\n\n使用方法\n\nfunc main(){\n\tg := gin.New()\n\n\tsession_config := `{\n\t\t\"storeDriver\":\"redis\",\n\t\t\"cookieName\":\"session_id\",\n\t\t\"EnableSetCookie\":true,\n\t\t\"secure\":false,\n\t\t\"cookieLifeTime\": 3,\n\t\t\"Domain\":\"\"\n\t}`\n\ts := g.Group(\"/\")\n\ts.Use(gsession.Middleware(session_config))\n\t{\n\t\ts.GET(\"/\",func(c *gin.Context){\n\t\t\tsess := gsession.GetSession(c);\n\t\t\tsess.Set(\"uid\",\"22\")\n\t\t})\n\t\ts.GET(\"/member\",func(c *gin.Context){\n\t\t\tsess := gsession.GetSession(c);\n\t\t\tuid := sess.Get(\"uid\")\n\t\t\tfmt.Println(uid)\n\t\t})\n\t}\n\tg.Run(\":8888\")\n}\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibi%2Fgin-session","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibi%2Fgin-session","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibi%2Fgin-session/lists"}