@@ 289-298 (lines=10) @@ | ||
286 | $cache = isset( $this->sessionFieldCache[$id] ) ? $this->sessionFieldCache[$id] : []; |
|
287 | foreach ( $data as $key => $value ) { |
|
288 | if ( !array_key_exists( $key, $cache ) ) { |
|
289 | if ( $session->exists( $key ) ) { |
|
290 | // New in both, so ignore and log |
|
291 | $this->logger->warning( |
|
292 | __METHOD__ . ": Key \"$key\" added in both Session and \$_SESSION!" |
|
293 | ); |
|
294 | } else { |
|
295 | // New in $_SESSION, keep it |
|
296 | $session->set( $key, $value ); |
|
297 | $changed = true; |
|
298 | } |
|
299 | } elseif ( $cache[$key] === $value ) { |
|
300 | // Unchanged in $_SESSION, so ignore it |
|
301 | } elseif ( !$session->exists( $key ) ) { |
|
@@ 301-308 (lines=8) @@ | ||
298 | } |
|
299 | } elseif ( $cache[$key] === $value ) { |
|
300 | // Unchanged in $_SESSION, so ignore it |
|
301 | } elseif ( !$session->exists( $key ) ) { |
|
302 | // Deleted in Session, keep but log |
|
303 | $this->logger->warning( |
|
304 | __METHOD__ . ": Key \"$key\" deleted in Session and changed in \$_SESSION!" |
|
305 | ); |
|
306 | $session->set( $key, $value ); |
|
307 | $changed = true; |
|
308 | } elseif ( $cache[$key] === $session->get( $key ) ) { |
|
309 | // Unchanged in Session, so keep it |
|
310 | $session->set( $key, $value ); |
|
311 | $changed = true; |