目录

CLASS info
public final class NetworkTool
Uses a specified parameter to construct a cookie help class.

Public Method Summary

Return typeMethod name
static String

public static String buildNetworkUrl(String domain, Boolean isUseHttps)

Returns cookie url based on the domain name and isUseHttps.

static String

public static String buildNetworkCookie(String cookieName, String cookieValue, String domain, String path, Boolean isHttpOnly, Boolean isSecure, Long maxAge)

Constructs a cookie by combining input values.

Public Methods

Method
public static String buildNetworkUrl(String domain, Boolean isUseHttps)
Returns cookie url based on the domain name and isUseHttps.

Parameters

Parameter nameParameter desc
domainDomain name.
isUseHttpsValue true indicates HTTPS, and value false indicates HTTP.


Return

typedesc
Stringcookie url
Method
public static String buildNetworkCookie(String cookieName, String cookieValue, String domain, String path, Boolean isHttpOnly, Boolean isSecure, Long maxAge)
Constructs a cookie by combining input values.

Parameters

Parameter nameParameter desc
cookieNameCookie name.
cookieValueCookie value.
domainCookie domain name.
pathPage path for accessing the cookie.
isHttpOnlyValue true indicates that the cookie information is contained only in the HTTP request header and cannot be accessed through document.cookie.
isSecureValue true indicates that the cookie can be transmitted only through HTTPS, and value false indicates that the cookie can be transmitted through HTTP.
maxAgeCookie lifetime, in seconds.


Return

typedesc
StringCombined cookie data.