本文整理汇总了C++中Cookie::DiscardAtExit方法的典型用法代码示例。如果您正苦于以下问题:C++ Cookie::DiscardAtExit方法的具体用法?C++ Cookie::DiscardAtExit怎么用?C++ Cookie::DiscardAtExit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::DiscardAtExit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HasCookies
BOOL CookiePath::HasCookies(time_t this_time)
{
Cookie* ck = (Cookie*) cookie_list.First();
while (ck)
{
if (!ck->DiscardAtExit() && ck->Expires() > this_time)
return TRUE;
ck = ck->Suc();
}
CookiePath* cp = (CookiePath*) FirstChild();
while (cp)
{
if (cp->HasCookies(this_time))
return TRUE;
cp = cp->Suc();
}
return FALSE;
}
示例2: GetCookieL
Cookie* CookiePath::GetCookieL(Cookie_Item_Handler *params, BOOL create)
{
Cookie* ck = LocalGetCookie(params->name);
if (!create)
return ck;
if (ck)
{
#ifdef _ASK_COOKIE
ServerName *servername = (ServerName *) params->url->GetAttribute(URL::KServerName, (const void*) 0);
COOKIE_DELETE_ON_EXIT_MODE disc_mode = (servername ? servername->GetDeleteCookieOnExit(TRUE) : COOKIE_EXIT_DELETE_DEFAULT);
BOOL default_disc_mode = (BOOL) g_pcnet->GetIntegerPref(PrefsCollectionNetwork::AcceptCookiesSessionOnly);
if(
((default_disc_mode && disc_mode != COOKIE_NO_DELETE_ON_EXIT) ||
(!default_disc_mode && disc_mode == COOKIE_DELETE_ON_EXIT))&&
!params->flags.discard_at_exit && !ck->DiscardAtExit())
params->flags.discard_at_exit= TRUE;
#endif
if(!params->flags.accept_updates)
params->flags.accept_updates = ck->AcceptUpdates();
if(!params->flags.accepted_as_third_party)
params->flags.accepted_as_third_party = ck->GetAcceptedAsThirdParty();
if(!params->flags.have_password)
params->flags.have_password = ck->GetHavePassword();
if(!params->flags.have_authentication)
params->flags.have_authentication = ck->GetHaveAuthentication();
OP_DELETE(ck);
// *** Don't save an expired cookie.
if(params->expire && params->expire <
(time_t) (g_op_time_info->GetTimeUTC()/1000.0)
)
return NULL;
}
ck = Cookie::CreateL(params);
ck->Into(&cookie_list);
return ck;
}
示例3: DebugWriteCookies
void CookiePath::DebugWriteCookies(FILE* fp)
{
fprintf(fp, " ");
DebugWritePath(fp);
fprintf(fp, ": \n");
Cookie* ck = (Cookie*) cookie_list.First();
while (ck)
{
fprintf(fp, " %s=%s; %lu; %d; %lu %s\n", ck->Name(), ck->Value(), ck->Expires(), ck->Secure(), ck->GetLastUsed(), (ck->DiscardAtExit() ? "; Discard on exit" : ""));
ck = ck->Suc();
}
CookiePath* cp = (CookiePath*) FirstChild();
while (cp)
{
cp->DebugWriteCookies(fp);
cp = cp->Suc();
}
}