File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,9 @@ public function close()
80
80
public function destroy ($ session_id )
81
81
{
82
82
if (headers_sent ()) {
83
- return false ;
83
+ setcookie ( self :: COOKIE_PREFIX . $ this -> suffix , null ) ;
84
84
}
85
85
86
- setcookie (self ::COOKIE_PREFIX . $ this ->suffix , null );
87
86
return true ;
88
87
}
89
88
@@ -174,11 +173,10 @@ public function write($session_id, $session_data)
174
173
$ data = $ jwt ->createJwtData ($ this ->unSerializeSessionData ($ session_data ), $ this ->timeOutMinutes * 60 );
175
174
$ token = $ jwt ->generateToken ($ data );
176
175
177
- if (headers_sent ()) {
178
- return false ;
176
+ if (! headers_sent ()) {
177
+ setcookie ( self :: COOKIE_PREFIX . $ this -> suffix , $ token ) ;
179
178
}
180
179
181
- setcookie (self ::COOKIE_PREFIX . $ this ->suffix , $ token );
182
180
return true ;
183
181
}
184
182
You can’t perform that action at this time.
0 commit comments