Esempio n. 1
0
void WebEventServiceImpl::preflightRequest(Poco::Net::HTTPServerRequest& request)
{
    if (_maxSockets > 0 && _socketMap.size() >= _maxSockets)
    {
        request.response().setStatusAndReason(Poco::Net::HTTPResponse::HTTP_SERVICE_UNAVAILABLE);
    }
}
Esempio n. 2
0
void WebSessionManager::addCookie(const std::string& appName, const Poco::Net::HTTPServerRequest& request, WebSession::Ptr pSession)
{
	Poco::Net::HTTPCookie cookie(cookieName(appName), pSession->id());
	if (_cookiePersistence == COOKIE_PERSISTENT)
	{
		cookie.setMaxAge(pSession->timeout());
	}
	cookie.setPath(cookiePath(appName));
	cookie.setDomain(cookieDomain(appName));
	cookie.setHttpOnly();
	request.response().addCookie(cookie);
}