{"id":15025472,"url":"https://github.com/ph-7/cookiesession","last_synced_at":"2025-04-09T20:03:50.736Z","repository":{"id":57038416,"uuid":"52692021","full_name":"pH-7/CookieSession","owner":"pH-7","description":" :cookie: CookieSession is a light PHP 7 library to manage very easily and simply Session and Cookie and without spending time by configure and secure PHP cookie and session  :lollipop:","archived":false,"fork":false,"pushed_at":"2017-07-03T01:37:09.000Z","size":19,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T20:03:44.329Z","etag":null,"topics":["cookie","cookiesession","library","light-library","php","php-7","php7","session","sessionmanager"],"latest_commit_sha":null,"homepage":"http://github.com/pH-7/CookieSession","language":"PHP","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/pH-7.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}},"created_at":"2016-02-27T22:29:49.000Z","updated_at":"2025-01-06T02:53:51.000Z","dependencies_parsed_at":"2022-08-23T21:00:32.276Z","dependency_job_id":null,"html_url":"https://github.com/pH-7/CookieSession","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FCookieSession","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FCookieSession/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FCookieSession/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pH-7%2FCookieSession/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pH-7","download_url":"https://codeload.github.com/pH-7/CookieSession/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103864,"owners_count":21048245,"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","cookiesession","library","light-library","php","php-7","php7","session","sessionmanager"],"created_at":"2024-09-24T20:02:24.950Z","updated_at":"2025-04-09T20:03:50.706Z","avatar_url":"https://github.com/pH-7.png","language":"PHP","readme":"# CookieSession\n\n**CookieSession** is a very light library to manage easily and simply the Session and Cookie with PHP 7+ (and without spending time by configuring and securing them).\n\n\n## Composer Installation\n\n You can add it easily in your projec by using [Composer](https://getcomposer.org/).\n\n\n```bash\n$ composer require ph-7/cookiesession\n ```\n\nThen, include Composer's autoload\n\n```PHP\nrequire_once 'vendor/autoload.php';\n```\n\n## Manual Installation\n\nIf you don't use Composer, you can install it without Composer by including the following\n\n```PHP\nrequire 'src/autoloader.php';\n```\n\n\n## Usage for Session\n\n```PHP\n\u003c?php\nuse PH7\\CookieSession\\Session\\Session;\n\n$oSession = new Session;\n\n$oSession-\u003eset('lang_pref', 'English');\n\n// Create some sessions with an array\n$aData = [\n    'my_session' =\u003e 'The value',\n    'another_session' =\u003e 'Another value',\n    'my_name' =\u003e 'Pierre-Henry'\n];\n// Add these sessions\n$oSession-\u003eset($aData);\n\n\n// Get session\necho $oSession-\u003eget('lang_pref'); // Will display 'English'\necho $oSession-\u003eget('another_session'); // Will display 'Another value'\n\necho ($oSession-\u003eexists('my_name')) ? $oSession-\u003eget('my_name') : 'Well, well, we dont have a name in the session'; // Will display 'Pierre-Henry'\n\n$oSession-\u003eremove('my_name'); // Remove 'my_name' session\n\necho $oSession-\u003eget('my_name'); // Will display nothing (empty string) as 'my_name' session has been removed\n```\n\n\n## Usage with Cookie (very similar)\n\n```PHP\n\u003c?php\nuse PH7\\CookieSession\\Cookie\\Cookie;\n\n$oCookie = new Cookie;\n\n$oCookie-\u003eset('mycookie', 'Amazing Value!');\n\n// Create some cookies in array\n$aCookies = [\n    'name' =\u003e 'Pierre-Henry',\n    'city' =\u003e 'Manchester',\n    'job' =\u003e 'Software Engineer'\n];\n$oCookie-\u003eset($aCookies);\n\nif ($oCookie-\u003eexists($aCookies)) {\n    echo 'All the following cookies exist: ' . implode(', ', $aCookies);\n}\n\necho $oCookie-\u003eget('name'); // Will display 'Pierre-Henry'\necho $oCookie-\u003eget('mycookie'); // Will display 'Amazing Value!'\n\n$oCookie-\u003eremove($aCookies); // Remove all cookies\n\necho $oCookie-\u003eget('name');  // Will display nothing (empty string)\n\n```\n\n\n## Requirements\n\n- PHP 7 or higher\n\n\n## The Author\n\nI'm **Pierre-Henry Soria**, **Software Developer** passionate about a lot of things and currently living in Manchester city, UK\n\n\n## Contact\n\nYou can send an email at **pierrehenrysoria [AT] gmail {D0T} COM** or at **phy {AT} hizup [D0T] UK**\n\n\n## License\n\nUnder [General Public License 3](http://www.gnu.org/licenses/gpl.html) or later.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph-7%2Fcookiesession","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fph-7%2Fcookiesession","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph-7%2Fcookiesession/lists"}