{"id":13781521,"url":"https://github.com/thinkjs/think-session","last_synced_at":"2025-07-01T08:05:35.286Z","repository":{"id":65374782,"uuid":"85146659","full_name":"thinkjs/think-session","owner":"thinkjs","description":"Session for ThinkJS 3.x","archived":false,"fork":false,"pushed_at":"2021-07-01T15:36:20.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-22T04:01:51.722Z","etag":null,"topics":["session","think-extend","thinkjs3"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/thinkjs.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-03-16T03:08:24.000Z","updated_at":"2021-07-01T15:36:15.000Z","dependencies_parsed_at":"2023-01-20T01:25:24.118Z","dependency_job_id":null,"html_url":"https://github.com/thinkjs/think-session","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-session","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-session/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-session/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-session/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinkjs","download_url":"https://codeload.github.com/thinkjs/think-session/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522336,"owners_count":20952524,"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":["session","think-extend","thinkjs3"],"created_at":"2024-08-03T18:01:26.747Z","updated_at":"2025-04-06T17:31:39.456Z","avatar_url":"https://github.com/thinkjs.png","language":"JavaScript","readme":"# think-session\n[![Build Status](https://img.shields.io/travis/thinkjs/think-session/master.svg?style=flat-square)](https://travis-ci.org/thinkjs/think-session)\n[![Coverage Status](https://img.shields.io/coveralls/thinkjs/think-session/master.svg?style=flat-square)](https://coveralls.io/github/thinkjs/think-session?branch=master)\n[![npm](https://img.shields.io/npm/v/think-session.svg?colorB=brightgreen\u0026style=flat-square)](https://www.npmjs.com/package/think-session)\n\n\nSession for ThinkJS 3.x.\n\nAdd `session` method for controller/context.\n\n## config\n\nconfig file `src/config/adapter.js`, add options:\n\n```js\nconst cookie = require('think-session-cookie');\nexports.session = {\n  type: 'cookie',\n  common: {\n    maxAge: 24 * 3600 * 1000, // 1 day \n  },\n  cookie: {\n    handle: cookie\n  }\n}\n```\n\n## session method\n\n* `this.session()` get all session data\n* `this.session(name)` get session data with name\n* `this.session(name, value)` set session data\n* `this.session(null)` delete all session data\n* `this.session(name, undefined, options)` get session data with options\n\n*For each `ctx`, session is only instantiated once.*\n","funding_links":[],"categories":["Extends"],"sub_categories":["websocket"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkjs%2Fthink-session","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinkjs%2Fthink-session","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkjs%2Fthink-session/lists"}