novemb3r / nginx-uid-decoder
A simple library to decode/encode uid from ngx_http_userid_module
Installs: 8 582
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^7.4
This package is auto-updated.
Last update: 2024-10-29 06:06:10 UTC
README
A simple library to decode/encode uid from ngx_http_userid_module
Based on Alain Tiemblo answer on stackoverflow
When you use ngx_http_userid_module cookies set to variables $uid_got and $uid_set has format that differs from the one you get from user cookies. So, you have to decode them to compare.
Examples
NginxUidDecoder::decodeCookie('CqCx7E5qMNUxrmAUAwMJAg==');
// 'ECB1A00AD5306A4E1460AE3102090303'
NginxUidDecoder::encodeUid('ECB1A00AD5306A4E1460AE3102090303');
// 'CqCx7E5qMNUxrmAUAwMJAg=='
Installing
This library installs as a composer package with
$ composer require novemb3r/nginx-uid-decoder
or
{
"require": {
"novemb3r/nginx-uid-decoder": "dev-master"
}
}
Testing
To execute test suites run
$ composer test