Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

SessionUtils.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.57 KiB


01  <?php
02   
03  /*
04   * This file is part of the Symfony package.
05   *
06   * (c) Fabien Potencier <fabien@symfony.com>
07   *
08   * For the full copyright and license information, please view the LICENSE
09   * file that was distributed with this source code.
10   */
11   
12  namespace Symfony\Component\HttpFoundation\Session;
13   
14  /**
15   * Session utility functions.
16   *
17   * @author Nicolas Grekas <p@tchwork.com>
18   * @author Rémon van de Kamp <rpkamp@gmail.com>
19   *
20   * @internal
21   */
22  final class SessionUtils
23  {
24      /**
25       * Find the session header amongst the headers that are to be sent, remove it, and return
26       * it so the caller can process it further.
27       */
28      public static function popSessionCookie($sessionName, $sessionId)
29      {
30          $sessionCookie = null;
31          $sessionCookiePrefix = sprintf(' %s=', urlencode($sessionName));
32          $sessionCookieWithId = sprintf('%s%s;', $sessionCookiePrefix, urlencode($sessionId));
33          $otherCookies = [];
34          foreach (headers_list() as $h) {
35              if (0 !== stripos($h, 'Set-Cookie:')) {
36                  continue;
37              }
38              if (11 === strpos($h, $sessionCookiePrefix, 11)) {
39                  $sessionCookie = $h;
40   
41                  if (11 !== strpos($h, $sessionCookieWithId, 11)) {
42                      $otherCookies[] = $h;
43                  }
44              } else {
45                  $otherCookies[] = $h;
46              }
47          }
48          if (null === $sessionCookie) {
49              return null;
50          }
51   
52          header_remove('Set-Cookie');
53          foreach ($otherCookies as $h) {
54              header($h, false);
55          }
56   
57          return $sessionCookie;
58      }
59  }
60