https://github.com/mattrmiller/phalcon-dbsessionadapter
Phalcon PHP - Database Session adapter using a Model written in PHP
https://github.com/mattrmiller/phalcon-dbsessionadapter
phalcon-php php session session-management
Last synced: 20 days ago
JSON representation
Phalcon PHP - Database Session adapter using a Model written in PHP
- Host: GitHub
- URL: https://github.com/mattrmiller/phalcon-dbsessionadapter
- Owner: mattrmiller
- License: mit
- Created: 2014-07-11T16:47:53.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-06-24T19:13:30.000Z (almost 7 years ago)
- Last Synced: 2025-05-04T08:55:51.469Z (21 days ago)
- Topics: phalcon-php, php, session, session-management
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phalconphp-dbsessionadapter
Phalcon PHP - Database Session adapter using a Model.
# Installation
1) Copy Code into Respective Folders
- /app/Library/*
- /app/Models/*2) Database Table
```sql
CREATE TABLE `sessions` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(64) NOT NULL DEFAULT '',
`data` longtext NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`modified_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uuid` (`uuid`),
KEY `created_at` (`created_at`),
KEY `modified_at` (`modified_at`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
```3) Setup Service
```php
$di->set('session', function () use ($oConfig) {// Sessions
return new DbSessionAdapter(array(
'name' => 'myawesomeapplication',
'domain' => 'myawesomeapplication.com',
'secure' => 1,
'use_cookies' => 1,
'hash' => 'sha256',
'lifetime' => 0
));});
```4) Use Like Regular Phalcon Sessions
```php
$this->session->set('enjoy_our_code', 'ok');
```# Rules For Contributing
- Please make sure all changed files are run through gofmt
- Submit a PR for review
- Your name will be added below to Contributors# Author
[Matthew R. Miller](https://github.com/mattrmiller)# Contributors
[Matthew R. Miller](https://github.com/mattrmiller)# License
[MIT License](LICENSE)