{"id":19086805,"url":"https://github.com/jangbl/express-session-with-redis","last_synced_at":"2025-04-30T09:46:17.114Z","repository":{"id":42843473,"uuid":"253589787","full_name":"jangbl/express-session-with-redis","owner":"jangbl","description":"A cookie-based Node.js session implementation using Express.js and Redis","archived":false,"fork":false,"pushed_at":"2023-05-13T10:58:47.000Z","size":681,"stargazers_count":28,"open_issues_count":8,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-03T21:37:57.685Z","etag":null,"topics":["bcrypt","bcrypt-node","bcrypt-nodejs","connect-redis","cors","express","express-session","expressjs","login","node","node-js","nodejs","nodejs-api","password-hashing","redis","redis-session","session","session-store"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/jangbl.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-06T19:00:08.000Z","updated_at":"2024-08-12T19:56:58.000Z","dependencies_parsed_at":"2024-10-03T21:37:59.239Z","dependency_job_id":"9446ef97-145f-433f-b570-20ea9b32675e","html_url":"https://github.com/jangbl/express-session-with-redis","commit_stats":null,"previous_names":["jangbl/express-session-with-redis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jangbl%2Fexpress-session-with-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jangbl%2Fexpress-session-with-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jangbl%2Fexpress-session-with-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jangbl%2Fexpress-session-with-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jangbl","download_url":"https://codeload.github.com/jangbl/express-session-with-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223779728,"owners_count":17201287,"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":["bcrypt","bcrypt-node","bcrypt-nodejs","connect-redis","cors","express","express-session","expressjs","login","node","node-js","nodejs","nodejs-api","password-hashing","redis","redis-session","session","session-store"],"created_at":"2024-11-09T03:00:25.814Z","updated_at":"2024-11-09T03:01:40.327Z","avatar_url":"https://github.com/jangbl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express Session with Redis\n\nThis repository contains sample code on how to use [Redis](https://redis.io) for a cookie-based session implementation with [Redis](https://redis.io) and the Node.js [express](https://expressjs.com/) framework.\n\n\u003ch3 align=\"center\"\u003ePlease help this repo with a ⭐️ if you find it useful! 😁\u003c/h3\u003e\n\nThis repository is part of the [Sessions in express.js tutorial series on YouTube](https://www.youtube.com/watch?v=bvQah0k5-eA\u0026list=PL1Nml43UBm6fPP7cW9pAFTdZ_9QX2mBn2) provided by [productioncoder.com](https://productioncoder.com/).\n\n[![Express sessions with redis](images/sessions-in-express-with-redis-and-cookies.png)](https://www.youtube.com/watch?v=bvQah0k5-eA\u0026list=PL1Nml43UBm6fPP7cW9pAFTdZ_9QX2mBn2)\n\nFor updates, please reach out to [@_jgoebel](https://twitter.com/_jgoebel) on Twitter.\n\n## Session implementation with express.js and express-session\n\nThis repository illustrates how to create a session-based authentication system in [Express.js](https://expressjs.com/) and what configurations you need to perform for you server to also accept cookies from cross origins - a scenario that is typical for Single Page Applications (SPAs) written in modern frameworks such as [React](https://reactjs.org/) or [Vue](https://vuejs.org/).\n\n## Running this project\n\n### 1. Installing Redis\n\nMake sure that you have _[Redis](https://redis.io) running locally_ on your machine on its _default_ port `6379`.\n\nThis project assumes that your [Redis](https://redis.io) instance does _not require a password_ (which is the default).\n\nIf your local [Redis](https://redis.io) requires a password, please update the `db/redis.js` file to include the password field:\n\n```\nconst redisClient = redis.createClient({\n    port: 6379,\n    host: 'localhost',\n    password: 'your-password'\n});\n```\n\nIf you are on macOS, the easiest way to start up a [Redis](https://redis.io) instance is by using [Homebrew](https://brew.sh/)\n\n```\nbrew install redis\nbrew services start redis\n```\n\nTo stop [Redis](https://redis.io), you can run\n\n```\nbrew services  stop redis\n```\n\n### 2. Install dependencies\n\nRun:\n\n```\nnpm install\n```\n\nto install the project's dependencies.\n\n### 3. Start server\n\nExecute the `dev` script to start up your server.\n\n```\nnpm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjangbl%2Fexpress-session-with-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjangbl%2Fexpress-session-with-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjangbl%2Fexpress-session-with-redis/lists"}