SetCookieEx function

设置 Cookie 变量


Function:

bool UAPI SetCookieEx(
        int hMessage,
        LPCSTR lpcName,
        LPCSTR lpcValue,
        LPCSTR lpcExpire,
        dword dwMaxAge,
        LPCSTR lpcPath,
        LPCSTR lpcDomain
);

Parameters:

  • hMessage [in]:请求句柄
  • lpcName [in]:Cookie 变量名
  • lpcValue [in]:值
  • lpcExpire [in]:Cookie 绝对有效期(GMT)
  • dwMaxAge [in]:Cookie 相对有效期(秒),可以是任意数值或下述标志中的一个
Constant Value Notes
COOKIE_MAXAGE_NULL 0x00 浏览器不存储该 Cookie
COOKIE_MAXAGE_SESSION -1 Cookie 仅限于当前会话,浏览器关闭后失效
  • lpcPath [in]:Cookie 服务器路径
  • lpcDomain [in]:Cookie 域名

Return value:

  • Type:BOOL
  • Text:成功返回 TRUE,失败返回 FALSE

Remarks:

  1. 参数 lpcValue 不能为 NULLPTR,否则将导致函数失败
  2. 参数 lpcExpire 应为 GMT 时间,否则将导致 Cookie 无效
  3. 通常情况下参数 lpcExpire dwMaxAge 设置其一即可

Requirements:

Keyword Value
Minimum Agine Version 171012.1
Minimum SDK Version 171012.1
Header File h.message
Library Server kext

results matching ""

    No results matching ""