
#use wml::openssl-macros area=docs page=SSL_CTX_flush_sessions

<title>Documents, SSL_CTX_flush_sessions(3)</title>

<h1>SSL_CTX_flush_sessions(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_CTX_flush_sessions, SSL_flush_sessions - remove expired sessions

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);
 void SSL_flush_sessions(SSL_CTX *ctx, long tm);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_CTX_flush_sessions()</CODE> causes a run through the session
cache of
<STRONG>ctx</STRONG> to remove sessions expired at time <STRONG>tm</STRONG>.

</P>
<P>
<CODE>SSL_flush_sessions()</CODE> is a synonym for
<CODE>SSL_CTX_flush_sessions().</CODE>

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
If enabled, the internal session cache will collect all sessions
established up to the specified maximum number (see
<CODE>SSL_CTX_sess_set_cache_size()).</CODE> As sessions will not be reused
ones they are expired, they should be removed from the cache to save
resources. This can either be done automatically whenever 255 new sessions
were established (see
<A HREF="../ssl/SSL_CTX_set_session_cache_mode.html#">SSL_CTX_set_session_cache_mode(3)</A>) or manually by calling <CODE>SSL_CTX_flush_sessions().</CODE> 

</P>
<P>
The parameter <STRONG>tm</STRONG> specifies the time which should be used for the expiration test, in most
cases the actual time given by <CODE>time(0)</CODE> will be used.

</P>
<P>
<CODE>SSL_CTX_flush_sessions()</CODE> will only check sessions stored in
the internal cache. When a session is found and removed, the
remove_session_cb is however called to synchronize with the external cache
(see
<A HREF="../ssl/SSL_CTX_sess_set_get_cb.html#">SSL_CTX_sess_set_get_cb(3)</A>).

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../ssl/ssl.html#">ssl(3)</A>,
<A HREF="../ssl/SSL_CTX_set_session_cache_mode.html#">SSL_CTX_set_session_cache_mode(3)</A>,
<A HREF="../ssl/SSL_CTX_set_timeout.html#">SSL_CTX_set_timeout(3)</A>,
<A HREF="../ssl/SSL_CTX_sess_set_get_cb.html#">SSL_CTX_sess_set_get_cb(3)</A>



</P>
:}


