1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948SSL_CTX_flush_sessions, SSL_flush_sessions - remove expired sessions
6*2175Sjp161948
7*2175Sjp161948=head1 SYNOPSIS
8*2175Sjp161948
9*2175Sjp161948 #include <openssl/ssl.h>
10*2175Sjp161948
11*2175Sjp161948 void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);
12*2175Sjp161948 void SSL_flush_sessions(SSL_CTX *ctx, long tm);
13*2175Sjp161948
14*2175Sjp161948=head1 DESCRIPTION
15*2175Sjp161948
16*2175Sjp161948SSL_CTX_flush_sessions() causes a run through the session cache of
17*2175Sjp161948B<ctx> to remove sessions expired at time B<tm>.
18*2175Sjp161948
19*2175Sjp161948SSL_flush_sessions() is a synonym for SSL_CTX_flush_sessions().
20*2175Sjp161948
21*2175Sjp161948=head1 NOTES
22*2175Sjp161948
23*2175Sjp161948If enabled, the internal session cache will collect all sessions established
24*2175Sjp161948up to the specified maximum number (see SSL_CTX_sess_set_cache_size()).
25*2175Sjp161948As sessions will not be reused ones they are expired, they should be
26*2175Sjp161948removed from the cache to save resources. This can either be done
27*2175Sjp161948 automatically whenever 255 new sessions were established (see
28*2175Sjp161948L<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>)
29*2175Sjp161948or manually by calling SSL_CTX_flush_sessions().
30*2175Sjp161948
31*2175Sjp161948The parameter B<tm> specifies the time which should be used for the
32*2175Sjp161948expiration test, in most cases the actual time given by time(0)
33*2175Sjp161948will be used.
34*2175Sjp161948
35*2175Sjp161948SSL_CTX_flush_sessions() will only check sessions stored in the internal
36*2175Sjp161948cache. When a session is found and removed, the remove_session_cb is however
37*2175Sjp161948called to synchronize with the external cache (see
38*2175Sjp161948L<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)>).
39*2175Sjp161948
40*2175Sjp161948=head1 RETURN VALUES
41*2175Sjp161948
42*2175Sjp161948=head1 SEE ALSO
43*2175Sjp161948
44*2175Sjp161948L<ssl(3)|ssl(3)>,
45*2175Sjp161948L<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>,
46*2175Sjp161948L<SSL_CTX_set_timeout(3)|SSL_CTX_set_timeout(3)>,
47*2175Sjp161948L<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)>
48*2175Sjp161948
49*2175Sjp161948=cut
50