New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

php-session-unserialize

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

php-session-unserialize

For unserialize PHP session in redis into JSON

latest
Source
npmnpm
Version
0.2.2
Version published
Weekly downloads
652
-2.54%
Maintainers
1
Weekly downloads
 
Created
Source

node-php-session-unserialize

Build Status JavaScript Style Guide Coverage Status

For unserialize PHP session in redis. When your PHP session in redis is like this 62kf0k2a4minrtcbr6h1l104r2|a:5:{s:3:"bar";c:4:"name":2:{s:3:"foo";i:9;}s:4:"user";s:4:"foo2";s:6:"result";b:1;s:5:"group";i:9;s:9:"is_banned";i:0;}. This module can help you parse it into JSON.

const unserializer = require('php-session-unserialize')
const session = `62kf0k2a4minrtcbr6h1l104r2|a:5:{s:3:"bar";c:4:"name":2:{s:3:"foo";i:9;}s:4:"user";s:4:"foo2";s:6:"result";b:1;s:5:"group";i:9;s:9:"is_banned";i:0;}`
console.log(unserializer(session))
/*
output:
{
	'62kf0k2a4minrtcbr6h1l104r2': [
      bar: {
        name: [Array]
      },
      user: 'foo2',
      result: true,
      group: 9,
      is_banned: 0
    ]
}

  • More example can see output of testing. test/index.js

Install

$ npm install php-session-unserialize

Test

$ npm test

TODO

  • Much clear error handle.
  • Browser support.

License

MIT

Keywords

php

FAQs

Package last updated on 27 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts