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

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

<h1>SSL_SESSION_get_time(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_SESSION_get_time, SSL_SESSION_set_time, SSL_SESSION_get_timeout,
SSL_SESSION_set_timeout - retrieve and manipulate session time and timeout
settings

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> long SSL_SESSION_get_time(const SSL_SESSION *s);
 long SSL_SESSION_set_time(SSL_SESSION *s, long tm);
 long SSL_SESSION_get_timeout(const SSL_SESSION *s);
 long SSL_SESSION_set_timeout(SSL_SESSION *s, long tm);
</PRE>
<PRE> long SSL_get_time(const SSL_SESSION *s);
 long SSL_set_time(SSL_SESSION *s, long tm);
 long SSL_get_timeout(const SSL_SESSION *s);
 long SSL_set_timeout(SSL_SESSION *s, long tm);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_SESSION_get_time()</CODE> returns the time at which the session <STRONG>s</STRONG> was established. The time is given in seconds since the Epoch and therefore
compatible to the time delivered by the <CODE>time()</CODE> call.

</P>
<P>
<CODE>SSL_SESSION_set_time()</CODE> replaces the creation time of the
session <STRONG>s</STRONG> with the chosen value <STRONG>tm</STRONG>.

</P>
<P>
<CODE>SSL_SESSION_get_timeout()</CODE> returns the timeout value set for
session <STRONG>s</STRONG>
in seconds.

</P>
<P>
<CODE>SSL_SESSION_set_timeout()</CODE> sets the timeout value for session <STRONG>s</STRONG> in seconds to <STRONG>tm</STRONG>.

</P>
<P>
The <CODE>SSL_get_time(),</CODE> <CODE>SSL_set_time(),</CODE>
<CODE>SSL_get_timeout(),</CODE> and <CODE>SSL_set_timeout()</CODE>
functions are synonyms for the SSL_SESSION_*() counterparts.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
Sessions are expired by examining the creation time and the timeout value.
Both are set at creation time of the session to the actual time and the
default timeout value at creation, respectively, as set by
<A HREF="../ssl/SSL_CTX_set_timeout.html#">SSL_CTX_set_timeout(3)</A>. Using these functions it is possible to extend or shorten the lifetime of
the session.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>SSL_SESSION_get_time()</CODE> and
<CODE>SSL_SESSION_get_timeout()</CODE> return the currently valid values.

</P>
<P>
<CODE>SSL_SESSION_set_time()</CODE> and
<CODE>SSL_SESSION_set_timeout()</CODE> return 1 on success.

</P>
<P>
If any of the function is passed the NULL pointer for the session <STRONG>s</STRONG>, 0 is returned.

</P>
<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_timeout.html#">SSL_CTX_set_timeout(3)</A>,
<A HREF="../ssl/SSL_get_default_timeout.html#">SSL_get_default_timeout(3)</A>



</P>
:}

