@@ -83,7 +83,7 @@ public function __construct(\PDO $pdo, array $dbOptions = array())
83
83
/**
84
84
* {@inheritdoc}
85
85
*/
86
- public function open ($ path , $ name )
86
+ public function open ($ savePath , $ sessionName )
87
87
{
88
88
return true ;
89
89
}
@@ -99,14 +99,14 @@ public function close()
99
99
/**
100
100
* {@inheritdoc}
101
101
*/
102
- public function destroy ($ id )
102
+ public function destroy ($ sessionId )
103
103
{
104
104
// delete the record associated with this id
105
105
$ sql = "DELETE FROM $ this ->table WHERE $ this ->idCol = :id " ;
106
106
107
107
try {
108
108
$ stmt = $ this ->pdo ->prepare ($ sql );
109
- $ stmt ->bindParam (':id ' , $ id , \PDO ::PARAM_STR );
109
+ $ stmt ->bindParam (':id ' , $ sessionId , \PDO ::PARAM_STR );
110
110
$ stmt ->execute ();
111
111
} catch (\PDOException $ e ) {
112
112
throw new \RuntimeException (sprintf ('PDOException was thrown when trying to delete a session: %s ' , $ e ->getMessage ()), 0 , $ e );
@@ -118,14 +118,14 @@ public function destroy($id)
118
118
/**
119
119
* {@inheritdoc}
120
120
*/
121
- public function gc ($ lifetime )
121
+ public function gc ($ maxlifetime )
122
122
{
123
123
// delete the session records that have expired
124
124
$ sql = "DELETE FROM $ this ->table WHERE $ this ->timeCol < :time " ;
125
125
126
126
try {
127
127
$ stmt = $ this ->pdo ->prepare ($ sql );
128
- $ stmt ->bindValue (':time ' , time () - $ lifetime , \PDO ::PARAM_INT );
128
+ $ stmt ->bindValue (':time ' , time () - $ maxlifetime , \PDO ::PARAM_INT );
129
129
$ stmt ->execute ();
130
130
} catch (\PDOException $ e ) {
131
131
throw new \RuntimeException (sprintf ('PDOException was thrown when trying to delete expired sessions: %s ' , $ e ->getMessage ()), 0 , $ e );
@@ -137,13 +137,13 @@ public function gc($lifetime)
137
137
/**
138
138
* {@inheritdoc}
139
139
*/
140
- public function read ($ id )
140
+ public function read ($ sessionId )
141
141
{
142
142
$ sql = "SELECT $ this ->dataCol FROM $ this ->table WHERE $ this ->idCol = :id " ;
143
143
144
144
try {
145
145
$ stmt = $ this ->pdo ->prepare ($ sql );
146
- $ stmt ->bindParam (':id ' , $ id , \PDO ::PARAM_STR );
146
+ $ stmt ->bindParam (':id ' , $ sessionId , \PDO ::PARAM_STR );
147
147
$ stmt ->execute ();
148
148
149
149
// We use fetchAll instead of fetchColumn to make sure the DB cursor gets closed
@@ -162,7 +162,7 @@ public function read($id)
162
162
/**
163
163
* {@inheritdoc}
164
164
*/
165
- public function write ($ id , $ data )
165
+ public function write ($ sessionId , $ data )
166
166
{
167
167
// Session data can contain non binary safe characters so we need to encode it.
168
168
$ encoded = base64_encode ($ data );
@@ -175,7 +175,7 @@ public function write($id, $data)
175
175
176
176
if (null !== $ mergeSql ) {
177
177
$ mergeStmt = $ this ->pdo ->prepare ($ mergeSql );
178
- $ mergeStmt ->bindParam (':id ' , $ id , \PDO ::PARAM_STR );
178
+ $ mergeStmt ->bindParam (':id ' , $ sessionId , \PDO ::PARAM_STR );
179
179
$ mergeStmt ->bindParam (':data ' , $ encoded , \PDO ::PARAM_STR );
180
180
$ mergeStmt ->bindValue (':time ' , time (), \PDO ::PARAM_INT );
181
181
$ mergeStmt ->execute ();
@@ -189,13 +189,13 @@ public function write($id, $data)
189
189
$ deleteStmt = $ this ->pdo ->prepare (
190
190
"DELETE FROM $ this ->table WHERE $ this ->idCol = :id "
191
191
);
192
- $ deleteStmt ->bindParam (':id ' , $ id , \PDO ::PARAM_STR );
192
+ $ deleteStmt ->bindParam (':id ' , $ sessionId , \PDO ::PARAM_STR );
193
193
$ deleteStmt ->execute ();
194
194
195
195
$ insertStmt = $ this ->pdo ->prepare (
196
196
"INSERT INTO $ this ->table ( $ this ->idCol , $ this ->dataCol , $ this ->timeCol ) VALUES (:id, :data, :time) "
197
197
);
198
- $ insertStmt ->bindParam (':id ' , $ id , \PDO ::PARAM_STR );
198
+ $ insertStmt ->bindParam (':id ' , $ sessionId , \PDO ::PARAM_STR );
199
199
$ insertStmt ->bindParam (':data ' , $ encoded , \PDO ::PARAM_STR );
200
200
$ insertStmt ->bindValue (':time ' , time (), \PDO ::PARAM_INT );
201
201
$ insertStmt ->execute ();
0 commit comments