SSL_CTX_flush_sessions.pod revision 72613
1233628Sfabient=pod
2233628Sfabient
3233628Sfabient=head1 NAME
4233628Sfabient
5233628SfabientSSL_CTX_flush_sessions, SSL_flush_sessions - remove expired sessions
6233628Sfabient
7233628Sfabient=head1 SYNOPSIS
8233628Sfabient
9233628Sfabient #include <openssl/ssl.h>
10233628Sfabient
11233628Sfabient void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);
12233628Sfabient void SSL_flush_sessions(SSL_CTX *ctx, long tm);
13233628Sfabient
14233628Sfabient=head1 DESCRIPTION
15233628Sfabient
16233628SfabientSSL_CTX_flush_sessions() causes a run through the session cache of
17233628SfabientB<ctx> to remove sessions expired at time B<tm>.
18233628Sfabient
19233628SfabientSSL_flush_sessions() is a synonym for SSL_CTX_flush_sessions().
20233628Sfabient
21233628Sfabient=head1 NOTES
22233628Sfabient
23233628SfabientIf enabled, the internal session cache will collect all sessions established
24233628Sfabientup to the specified maximum number (see SSL_CTX_sess_set_cache_size()).
25233628SfabientAs sessions will not be reused ones they are expired, they should be
26233628Sfabientremoved from the cache to save resources. This can either be done
27233628Sfabient automatically whenever 255 new sessions were established (see
28233628SfabientL<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>)
29233628Sfabientor manually by calling SSL_CTX_flush_sessions(). 
30233628Sfabient
31233628SfabientThe parameter B<tm> specifies the time which should be used for the
32233628Sfabientexpiration test, in most cases the actual time given by time(0)
33233628Sfabientwill be used.
34233628Sfabient
35233628SfabientSSL_CTX_flush_sessions() will only check sessions stored in the internal
36233628Sfabientcache. When a session is found and removed, the remove_session_cb is however
37233628Sfabientcalled to synchronize with the external cache (see
38233628SfabientL<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)>).
39233628Sfabient
40233628Sfabient=head1 RETURN VALUES
41233628Sfabient
42233628Sfabient=head1 SEE ALSO
43233628Sfabient
44233628SfabientL<ssl(3)|ssl(3)>,
45233628SfabientL<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>,
46233628SfabientL<SSL_CTX_set_timeout(3)|SSL_CTX_set_timeout(3)>,
47233628SfabientL<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)>
48233628Sfabient
49=cut
50