{"id":15470944,"url":"https://github.com/chekun/golaravelsession","last_synced_at":"2025-04-22T12:41:57.093Z","repository":{"id":142005585,"uuid":"92801957","full_name":"chekun/golaravelsession","owner":"chekun","description":"Go Laravel Session","archived":false,"fork":false,"pushed_at":"2019-05-08T05:24:17.000Z","size":7,"stargazers_count":19,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T01:13:33.227Z","etag":null,"topics":["golang","laravel","session"],"latest_commit_sha":null,"homepage":null,"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/chekun.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}},"created_at":"2017-05-30T05:45:03.000Z","updated_at":"2024-10-11T02:04:00.000Z","dependencies_parsed_at":"2024-06-20T01:43:52.119Z","dependency_job_id":"1467a2c4-a6c0-433e-a648-f8848ce44f17","html_url":"https://github.com/chekun/golaravelsession","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fgolaravelsession","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fgolaravelsession/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fgolaravelsession/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chekun%2Fgolaravelsession/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chekun","download_url":"https://codeload.github.com/chekun/golaravelsession/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241699007,"owners_count":20005302,"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","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":["golang","laravel","session"],"created_at":"2024-10-02T02:08:00.930Z","updated_at":"2025-03-03T16:30:58.816Z","avatar_url":"https://github.com/chekun.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Go Laravel Session\n========================\n\n\u003ca href=\"https://travis-ci.org/chekun/golaravelsession\"\u003e\u003cimg src=\"https://api.travis-ci.org/chekun/golaravelsession.svg?branch=master\u0026style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\nBasic Decrypt Laravel's SessionID and Read Session Data support for golang.\n\n### Features\n\n- Decrypt SessionID (now for the default `AES-256-CBC` cipher only)\n- Read Session Data from php-serialized format\n\n### Purpose\n\n- golang websocket app combined with laravel app (authorize user)\n- other\n\n### Examples\n\n- GetSessionID\n\n```go\ncookie := \"eyJpdiI6IjVrTVVDSmlyb1FtN2NrbmlOTllOUkE9PSIsInZhbHVlIjoiUU9pbCtMTjhQQnQyamJ6ZE5qenVWanhuZktUcjBkOUVsWU5ibkhlWHJyc25DNnZYQlRrOWlFd01ObVJwam1yVUtNcGRUanV1aEJIWHBsYXNiZytNenc9PSIsIm1hYyI6ImMzYzVmMGE1NWY5ZjEzMzRjOTVkN2FlZGY2YzZhNDExOTVhZjUzMjYzZmE3OTE1ODIwYWYzNmY5ODQzYjIwOGEifQ==\"\nkey := \"base64:qsDvCdhT+JPXEBD3ys/XraOXVNpshsyElzJmtgnBqEI=\"\n\nsessionID, _ := GetSessionID(cookie, key)\nfmt.Println(sessionID)\n//produces: RYodG5AekDidQCVLvs4fQIRAPSwarZV26U4shNVX\n```\n\n- ParseSessionData\n\nthis is just wrapper usage of package \n[`github.com/yvasiyarov/php_session_decoder/php_serialize`](https://github.com/yvasiyarov/php_session_decoder/tree/master/php_serialize)\n\n```go\nsessionData := `a:5:{s:6:\"_token\";s:40:\"eE5gVNqGSn6wneCJAzhtTMulPFwvOfDyZRSoVStA\";s:3:\"url\";a:0:{}s:9:\"_previous\";a:1:{s:3:\"url\";s:29:\"https://test.dev\";}s:6:\"_flash\";a:2:{s:3:\"old\";a:0:{}s:3:\"new\";a:0:{}}s:52:\"login_admin_59ba36addc2b2f9401580f014c7f58ea4e30989d\";i:1;}`\nsession, _ := ParseSessionData(sessionData)\nfmt.Println(session[\"_token\"].(string))\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchekun%2Fgolaravelsession","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchekun%2Fgolaravelsession","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchekun%2Fgolaravelsession/lists"}