<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.session-cache-expire.php',
    1 => 'session_cache_expire',
    2 => 'R&eacute;cup&egrave;re et/ou d&eacute;finit le d&eacute;lai d\'expiration du cache',
  ),
  'up' => 
  array (
    0 => 'ref.session.php',
    1 => 'Fonctions Session',
  ),
  'prev' => 
  array (
    0 => 'function.session-abort.php',
    1 => 'session_abort',
  ),
  'next' => 
  array (
    0 => 'function.session-cache-limiter.php',
    1 => 'session_cache_limiter',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/session/functions/session-cache-expire.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.session-cache-expire" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_cache_expire</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">session_cache_expire</span> &mdash; <span class="dc-title">Récupère et/ou définit le délai d&#039;expiration du cache</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.session-cache-expire-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>session_cache_expire</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.integer.php" class="type int">int</a></span></span> <code class="parameter">$value</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.integer.php" class="type int">int</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_cache_expire()</strong></span> retourne la configuration actuelle de
   <code class="literal">session.cache_expire</code>.
  </p>
  <p class="para">
   Le délai d&#039;expiration du cache est remis à sa valeur par défaut de
   180, stockée dans <a href="session.configuration.php#ini.session.cache-expire" class="link">session.cache_expire</a>,
   au démarrage de la requête. Par conséquent, il faut appeler
   <span class="function"><strong>session_cache_expire()</strong></span> à chaque requête (et avant
   que <span class="function"><a href="function.session-start.php" class="function">session_start()</a></span> ne soit appelée).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.session-cache-expire-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       Si <code class="parameter">value</code> est fourni et non <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, la
       configuration actuelle de cache expire sera remplacée par
       <code class="parameter">value</code>.
      </p>
      <p class="para">
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <span class="simpara">
         La directive <code class="parameter">value</code> n&#039;a de valeur que si
         <strong class="option unknown">session.cache_limiter</strong> a une valeur
         <em>différente</em> de <code class="literal">nocache</code>.
        </span>
       </p></blockquote>
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.session-cache-expire-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne la configuration courante de <code class="literal">session.cache_expire</code>.
   La valeur retournée doit être lue en minutes, et vaut par défaut, 180.
   En cas d&#039;échec de modification de la valeur, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> est retourné.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.session-cache-expire-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">value</code> est désormais nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.session-cache-expire-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>session_cache_expire()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/* Configure le limiteur de cache à 'private' */<br /><br /></span><span style="color: #0000BB">session_cache_limiter</span><span style="color: #007700">(</span><span style="color: #DD0000">'private'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$cache_limiter </span><span style="color: #007700">= </span><span style="color: #0000BB">session_cache_limiter</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/* Configure le délai d'expiration à 30 minutes */<br /></span><span style="color: #0000BB">session_cache_expire</span><span style="color: #007700">(</span><span style="color: #0000BB">30</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$cache_expire </span><span style="color: #007700">= </span><span style="color: #0000BB">session_cache_expire</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/* Démarre la session */<br /><br /></span><span style="color: #0000BB">session_start</span><span style="color: #007700">();<br /><br />echo </span><span style="color: #DD0000">"Le limiteur de cache est maintenant fixé à </span><span style="color: #0000BB">$cache_limiter</span><span style="color: #DD0000">&lt;br /&gt;"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"La session en cache va expirer après </span><span style="color: #0000BB">$cache_expire</span><span style="color: #DD0000"> minutes"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.session-cache-expire-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="session.configuration.php#ini.session.cache-expire" class="link">session.cache_expire</a></li>
    <li><a href="session.configuration.php#ini.session.cache-limiter" class="link">session.cache_limiter</a></li>
    <li><span class="function"><a href="function.session-cache-limiter.php" class="function" rel="rdfs-seeAlso">session_cache_limiter()</a> - Lit et/ou modifie le limiteur de cache de session</span></li>
   </ul>
  </p>
 </div>


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