{"id":16272567,"url":"https://github.com/arthurkushman/coossions","last_synced_at":"2025-03-19T23:31:07.758Z","repository":{"id":62488017,"uuid":"87329697","full_name":"arthurkushman/coossions","owner":"arthurkushman","description":"Coossions is a php plugin to store sessions in encrypted cookie","archived":false,"fork":false,"pushed_at":"2019-05-03T15:42:27.000Z","size":42,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T12:21:25.536Z","etag":null,"topics":["cookie","data","php","php7","session","storage"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"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/arthurkushman.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-04-05T16:02:38.000Z","updated_at":"2022-08-01T18:13:49.000Z","dependencies_parsed_at":"2022-11-02T11:01:32.263Z","dependency_job_id":null,"html_url":"https://github.com/arthurkushman/coossions","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkushman%2Fcoossions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkushman%2Fcoossions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkushman%2Fcoossions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurkushman%2Fcoossions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurkushman","download_url":"https://codeload.github.com/arthurkushman/coossions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244524836,"owners_count":20466509,"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":["cookie","data","php","php7","session","storage"],"created_at":"2024-10-10T18:18:15.345Z","updated_at":"2025-03-19T23:31:07.474Z","avatar_url":"https://github.com/arthurkushman.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coossions\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/arthurkushman/coossions/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/arthurkushman/coossions/?branch=master)\n[![Build Status](https://scrutinizer-ci.com/g/arthurkushman/coossions/badges/build.png?b=master)](https://scrutinizer-ci.com/g/arthurkushman/coossions/build-status/master)\n[![Code Coverage](https://scrutinizer-ci.com/g/arthurkushman/coossions/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/arthurkushman/coossions/?branch=master)\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)\n\nCoossions (stands for cookie-sessions) is a php plugin to store sessions in encrypted cookie\n\n## Installation via composer\n\n```zsh\n    composer require arthurkushman/coossions\n```\n\n## Usage\n\n```php\n    $coossions = new CoossionsHandler('your_digest_secrete'); // any secret word\n    $coossions-\u003estartSession();    \n```\n\nAnd then, as usual, in any code-space - set session global variables: \n\n```php\n    $_SESSION['foo'] = 123;\n    $_SESSION['bar'] = 'baz';    \n```\n\nGet session global variables:\n\n```php\n    echo $_SESSION['foo'] . ' ' . $_SESSION['bar'];    \n```\n\n## Details \n \nSession will be written in cookie on client-side with openssl cipher code (in aes-256-ctr cipher algorithm by default) \nand digested with `your_digest_secrete` (in sha256 by default). \nAlso, whole message will be merged with hash_hmac, based on salt consisting of dynamic SID + message, \nwhich will then checked by hash_equals to additionally identify non-fraudulent data stored in cookie.\n\nTo create reliable/secure cryptographic signature, it would be better if `your_digest_secrete` will be in both upper/lower case letters and mashed with digits + long enough.  \n\n## Setting custom hash and cryptographic algorithms through DI\n\nAlthough, there are already set the best known, at the moment, hash and crypto algos - You can set Your preferable ones:\n\n```php\n        $coossions = new CoossionsHandler('your_digest_secrete');\n        \n        $encryptor = new Encryptor('your_digest_secrete');\n        $encryptor-\u003esetDigestAlgo('sha512'); // defaults to sha256\n        $encryptor-\u003esetCipherAlgo('aes-128-ctr'); // defaults to aes-256-ctr\n        $coossions-\u003esetEncryption($encryptor);\n        \n        $coossions-\u003estartSession();        \n```\n\n## Performance \n\nTested performance of write/read 2 $_SESSION vars (3 symbols long int/string): \n \n- write avg time 6-8 microseconds\n- read avg time 5-7 microseconds ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurkushman%2Fcoossions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurkushman%2Fcoossions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurkushman%2Fcoossions/lists"}