Provide zblog template_zblog them_wordpress template download and customization

The built-in cookie calling code of zblog

Tianxing Studio 2020-06-19 20:23 Zblogphp Tutorial two thousand seven hundred and seventy-one 0 Comments


Zblog has a built-in cookie function, which makes it easier to set cookies and call cookies. This article will share the calling code of zblog's built-in cookies.

js cookie:

Get the cookie according to the key:

 zbp.cookie.get(CookieKey)

Set cookies:

 zbp.cookie.set(sCookieName,  sCookieValue, iExpireDays)

The three values of the set cookie are "cookie name", "cookie value" and "cookie time", which can be set according to your own requirements.

Take a chestnut:

Click the "btn" button to write a cookie named "bg" with a value of "1" and a time of "365" days. The code is as follows:

 $(".btn").click(function(){ zbp.cookie.set("bg", "1" , 365); });

php cookie

PHP uses PHP native functions to obtain and write cookie values.

Cookies are written using“ setcookie ()”;

"$_COOKIE ['']" is used to obtain cookies;

For the specific usage of these two functions, please visit the official PHP documentation: http://php.net/manual/zh/function.setcookie.php


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation