<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.session.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.session-id.php',
    1 => 'session_id',
    2 => 'Liefert und/oder setzt die aktuelle Session-ID',
  ),
  'up' => 
  array (
    0 => 'ref.session.php',
    1 => 'Session-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.session-get-cookie-params.php',
    1 => 'session_get_cookie_params',
  ),
  'next' => 
  array (
    0 => 'function.session-module-name.php',
    1 => 'session_module_name',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/session/functions/session-id.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.session-id" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_id</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">session_id</span> &mdash; <span class="dc-title">Liefert und/oder setzt die aktuelle Session-ID</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.session-id-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>session_id</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$id</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>session_id()</strong></span> wird verwendet, um die Session-ID der
   aktuellen Session zu erhalten oder zu setzen.
  </p>
  <p class="para">
   Die Konstante <strong><code><a href="session.constants.php#constant.sid">SID</a></code></strong> kann auch dazu verwendet werden, den
   aktuellen Namen und die Session-ID als Zeichenkette passend zum Anhängen an
   URLs zu erhalten. Siehe auch
   <a href="ref.session.php" class="link">Session-Funktionen</a>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.session-id-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">id</code></dt>
      <dd>
       <p class="para">
        Wenn <code class="parameter">id</code> angegeben wird und nicht <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> ist,
        wird die aktuelle Session-ID ersetzt. <span class="function"><strong>session_id()</strong></span>
        muss zu diesem Zweck vor <span class="function"><a href="function.session-start.php" class="function">session_start()</a></span> aufgerufen
        werden. In Abhängigkeit von der Session-Routine sind in der Session-ID
        nicht alle Zeichen erlaubt. Zum Beispiel erlaubt die dateibasierte
        Session-Routine nur Zeichen im Bereich
        <code class="literal">[a-zA-Z0-9,-]</code>!
       </p>
       <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
        <span class="simpara">
         Falls Session-Cookies verwendet werden und für
         <span class="function"><strong>session_id()</strong></span> eine <code class="parameter">id</code>
         angegeben wird, wird ungeachtet dessen, ob die aktuelle Session-ID
         mit der neuen identisch ist, bei jedem Aufruf von
         <span class="function"><a href="function.session-start.php" class="function">session_start()</a></span> ein neues Cookie gesendet.
        </span>
       </p></blockquote>
      </dd>
     
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.session-id-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   <span class="function"><strong>session_id()</strong></span> gibt die Session-ID der aktuellen Session
   zurück oder die leere Zeichenkette (<code class="literal">&quot;&quot;</code>), falls es keine
   aktuelle Session gibt (es existiert keine aktuelle Session-ID). Bei
   Auftreten eines Fehlers wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.session-id-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">id</code> ist jetzt nullable (akzeptiert den
       NULL-Wert).
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.session-id-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.session-regenerate-id.php" class="function" rel="rdfs-seeAlso">session_regenerate_id()</a> - Ersetzt die aktuelle Session-ID durch eine neu erzeugte</span></li>
    <li><span class="function"><a href="function.session-start.php" class="function" rel="rdfs-seeAlso">session_start()</a> - Erzeugt eine neue Session oder setzt eine vorhandene fort</span></li>
    <li><span class="function"><a href="function.session-set-save-handler.php" class="function" rel="rdfs-seeAlso">session_set_save_handler()</a> - Setzt benutzerdefinierte Session-Speicherfunktionen</span></li>
    <li><a href="session.configuration.php#ini.session.save-handler" class="link">session.save_handler</a></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>