Function enableSession

Summary

#include <lib/inc/drogon/HttpAppFramework.h>

(1) virtual HttpAppFramework & enableSession(const size_t timeout=0)=0

(2) HttpAppFramework & enableSession(const std::chrono::duration< long double > &timeout)

Function overload

Synopsis

#include <lib/inc/drogon/HttpAppFramework.h>

virtual HttpAppFramework & enableSession(const size_t timeout=0)=0

Description

Enable sessions supporting.

Parameters:

timeout - The number of seconds which is the timeout of a session

Note
Session support is disabled by default. If there isn't any request from a client for timeout(>0) seconds, the session of the client is destroyed. If the timeout parameter is equal to 0, sessions will remain permanently This operation can be performed by an option in the configuration file.

Mentioned in

Source

Line 656 in lib/inc/drogon/HttpAppFramework.h.

Synopsis

#include <lib/inc/drogon/HttpAppFramework.h>

HttpAppFramework & enableSession(const std::chrono::duration< long double > &timeout)

Description

A wrapper of the above method.

Example: Users can set the timeout value as follows:

app().enableSession(0.2h);
app().enableSession(12min);

Mentioned in

Source

Lines 666-670 in lib/inc/drogon/HttpAppFramework.h.

inline HttpAppFramework &enableSession(
    const std::chrono::duration<long double> &timeout)
{
    return enableSession((size_t)timeout.count());
}





Add Discussion as Guest

Log in to DocsForge