{"id":22243178,"url":"https://github.com/x42en/phpsession","last_synced_at":"2026-04-07T21:31:41.361Z","repository":{"id":30931898,"uuid":"34489883","full_name":"x42en/PHPSession","owner":"x42en","description":"Manage PHP $_SESSION var stored in JSON with node.js, using memcached server","archived":false,"fork":false,"pushed_at":"2017-03-17T01:26:44.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T10:43:05.854Z","etag":null,"topics":["coffeescript","memcache","nodejs","npm","php"],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x42en.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":"2015-04-24T00:56:28.000Z","updated_at":"2023-01-19T12:54:11.000Z","dependencies_parsed_at":"2022-09-21T01:05:02.698Z","dependency_job_id":null,"html_url":"https://github.com/x42en/PHPSession","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/x42en/PHPSession","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x42en%2FPHPSession","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x42en%2FPHPSession/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x42en%2FPHPSession/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x42en%2FPHPSession/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x42en","download_url":"https://codeload.github.com/x42en/PHPSession/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x42en%2FPHPSession/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005458,"owners_count":26083902,"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-10T02:00:06.843Z","response_time":62,"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":["coffeescript","memcache","nodejs","npm","php"],"created_at":"2024-12-03T04:21:25.201Z","updated_at":"2025-10-10T22:41:10.994Z","avatar_url":"https://github.com/x42en.png","language":"CoffeeScript","readme":"# PHPSession\n\n[![NPM](https://nodei.co/npm/phpsession.png?compact=true)](https://nodei.co/npm/phpsession/)\n\n[![Downloads per month](https://img.shields.io/npm/dm/phpsession.svg?maxAge=2592000)](https://www.npmjs.org/package/phpsession)\n[![npm version](https://img.shields.io/npm/v/phpsession.svg)](https://www.npmjs.org/package/phpsession)\n[![Build Status](https://travis-ci.org/x42en/PHPSession.svg?branch=master)](https://travis-ci.org/x42en/PHPSession)\n[![Dependencies](https://david-dm.org/x42en/phpsession.svg)](https://www.npmjs.org/package/phpsession)\n[![Known Vulnerabilities](https://snyk.io/test/github/x42en/phpsession/badge.svg)](https://snyk.io/test/github/x42en/phpsession)\n\nSimple module to manipulate PHP session vars ($_SESSION) stored in JSON, using *memcached*  \n\u003eCAREFUL: this is NEW version of memcache !\n\n**Important:** This package is **NOT** backward compatible with 0.1.x versions... Be careful if you update your npm project...\n\n\n## Install\n\nInstall with npm:\n  ```sh\n    npm install phpsession\n  ```\n  \n## Basic Usage\n\nRequire the module:\n  ```coffeescript\n    PHPSESSION = require 'phpsession'\n  ```\n\nInstantiate:\n  ```coffeescript\n    sess = new PHPSESSION()\n  ```\n\n\n## Method usage:\n\n### Connect to server:\n  ```coffeescript\n    sess.connect\n      host: 127.0.0.1  # Default value\n      port: 11211      # Default value\n  ```\n\n### Check server is connected\n  ```coffeescript\n    if sess.isConnected()\n      console.log 'All right !!'\n  ```\n\n### Retrieve $_SESSION value:\n  ```coffeescript\n    sess.get\n      id: '9eir0ul21knvmlhu0a4kleh8j1'\n      ,(data) -\u003e console.log data\n  ```\n\n### Define a $_SESSION var:\n  ```coffeescript\n    sess.set\n      id: '9eir0ul21knvmlhu0a4kleh8j1'\n      data: { 'hello': 'world' }\n      lifetime: 1440\n  ```\n\n### Replace a $_SESSION var:\n  ```coffeescript\n    sess.replace\n      id: '9eir0ul21knvmlhu0a4kleh8j1'\n      data: { 'hello': 'world' }\n      lifetime: 1440\n  ```\n\n### Refresh a $_SESSION:\n  ```coffeescript\n    sess.refresh\n      id: '9eir0ul21knvmlhu0a4kleh8j1'\n      lifetime: 1440\n  ```\n\n### Update specific $_SESSION key:\n  ```coffeescript\n    sess.update\n      id: '9eir0ul21knvmlhu0a4kleh8j1'\n      key: 'hello'\n      value: 'better world'\n      lifetime: 1440\n  ```\n\n### Delete $_SESSION id:\n  ```coffeescript\n    sess.delete\n      id: '9eir0ul21knvmlhu0a4kleh8j1'\n  ```\n\n\n## Extended usage\n\nAll methods supports callback parameters:\n  ```coffeescript\n    sess.set\n      id: '9eir0ul21knvmlhu0a4kleh8j1'\n      data: { 'hello': 'better world' }\n      , (res) -\u003e\n        console.log \"Received: #{res}\"\n        # Do something with result...\n  ```\n\n## Run tests\n\nYou can run unit-tests using mocha with:\n  ```sh\n    npm test\n  ```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx42en%2Fphpsession","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx42en%2Fphpsession","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx42en%2Fphpsession/lists"}