Skip to content

Commit fb66963

Browse files
committed
made a little more generic.
1 parent a48c90b commit fb66963

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/nbproject/private/
2+
/nbproject/

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,19 @@ db-sessions
22
===========
33

44
PHP Database Session Classes
5+
6+
Here are some PHP Session database classes.
7+
I decided to go with PDO. This is a work
8+
in progress.
9+
10+
Installation
11+
----------------------------
12+
13+
First you need to create a table in your database:
14+
15+
CREATE TABLE `session_handler` (
16+
`id` varchar(255) NOT NULL,
17+
`data` mediumtext NOT NULL,
18+
`timestamp` int(255) NOT NULL,
19+
PRIMARY KEY (`id`)
20+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

session_handler.php

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SessionHandler implements SessionHandlerInterface {
1616
protected $session_id = NULL;
1717
protected $session_written = FALSE;
1818

19-
const ADMIN_EMAIL = 'it@olwm.com';
19+
const ADMIN_EMAIL = 'admin@domain.tld';
2020

2121
/**
2222
* Automatically sets this instance to database session handler.
@@ -160,23 +160,4 @@ protected function prepare($query) {
160160
return $this->dbh->prepare(sprintf($query, $this->table));
161161
}
162162

163-
}
164-
165-
//class
166-
167-
/** PHP MySQL Session Handler
168-
========================
169-
170-
Installation
171-
----------------------------
172-
173-
First you need to create a table in your database:
174-
175-
CREATE TABLE `session_handler` (
176-
`id` varchar(255) NOT NULL,
177-
`data` mediumtext NOT NULL,
178-
`timestamp` int(255) NOT NULL,
179-
PRIMARY KEY (`id`)
180-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
181-
*
182-
*/
163+
}

0 commit comments

Comments
 (0)