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()
8080 public function destroy ($ session_id )
8181 {
8282 if (headers_sent ()) {
83- return false ;
83+ setcookie ( self :: COOKIE_PREFIX . $ this -> suffix , null ) ;
8484 }
8585
86- setcookie (self ::COOKIE_PREFIX . $ this ->suffix , null );
8786 return true ;
8887 }
8988
@@ -174,11 +173,10 @@ public function write($session_id, $session_data)
174173 $ data = $ jwt ->createJwtData ($ this ->unSerializeSessionData ($ session_data ), $ this ->timeOutMinutes * 60 );
175174 $ token = $ jwt ->generateToken ($ data );
176175
177- if (headers_sent ()) {
178- return false ;
176+ if (! headers_sent ()) {
177+ setcookie ( self :: COOKIE_PREFIX . $ this -> suffix , $ token ) ;
179178 }
180179
181- setcookie (self ::COOKIE_PREFIX . $ this ->suffix , $ token );
182180 return true ;
183181 }
184182
You can’t perform that action at this time.
0 commit comments