172613Skris=pod 272613Skris 372613Skris=head1 NAME 472613Skris 572613SkrisSSL_CTX_flush_sessions, SSL_flush_sessions - remove expired sessions 672613Skris 772613Skris=head1 SYNOPSIS 872613Skris 972613Skris #include <openssl/ssl.h> 1072613Skris 1172613Skris void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm); 1272613Skris void SSL_flush_sessions(SSL_CTX *ctx, long tm); 1372613Skris 1472613Skris=head1 DESCRIPTION 1572613Skris 1672613SkrisSSL_CTX_flush_sessions() causes a run through the session cache of 1772613SkrisB<ctx> to remove sessions expired at time B<tm>. 1872613Skris 1972613SkrisSSL_flush_sessions() is a synonym for SSL_CTX_flush_sessions(). 2072613Skris 2172613Skris=head1 NOTES 2272613Skris 2372613SkrisIf enabled, the internal session cache will collect all sessions established 2472613Skrisup to the specified maximum number (see SSL_CTX_sess_set_cache_size()). 2572613SkrisAs sessions will not be reused ones they are expired, they should be 2672613Skrisremoved from the cache to save resources. This can either be done 2772613Skris automatically whenever 255 new sessions were established (see 2872613SkrisL<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>) 2972613Skrisor manually by calling SSL_CTX_flush_sessions(). 3072613Skris 3172613SkrisThe parameter B<tm> specifies the time which should be used for the 3272613Skrisexpiration test, in most cases the actual time given by time(0) 3372613Skriswill be used. 3472613Skris 3572613SkrisSSL_CTX_flush_sessions() will only check sessions stored in the internal 3672613Skriscache. When a session is found and removed, the remove_session_cb is however 3772613Skriscalled to synchronize with the external cache (see 3872613SkrisL<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)>). 3972613Skris 4072613Skris=head1 RETURN VALUES 4172613Skris 4272613Skris=head1 SEE ALSO 4372613Skris 4472613SkrisL<ssl(3)|ssl(3)>, 4572613SkrisL<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>, 4672613SkrisL<SSL_CTX_set_timeout(3)|SSL_CTX_set_timeout(3)>, 4772613SkrisL<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)> 4872613Skris 4972613Skris=cut 50