正在加载
请稍等

菜单

红楼飞雪 梦

15526773247

文章

Home prestashop Managing Cookies
Home prestashop Managing Cookies

Managing Cookies

prestashop by

Managing Cookies

PrestaShop uses encrypted cookies to store all the session information, for visitors/clients as well as for employees/administrators.

The Cookie class (/classes/Cookie.php) is used to read and write cookies.

In order to access the cookies from within PrestaShop code, you can use this:

$this->context->cookie;

All the information stored within a cookie is available using this code:

$this->context->cookie->variable;

If you need to access the PrestaShop cookie from non-PrestaShop code, you can use this code:

include_once('path_to_prestashop/config/config.inc.php');
include_once('path_to_prestashop/config/settings.inc.php');
include_once('path_to_prestashop/classes/Cookie.php');
$cookie = new Cookie('ps'); // Use "psAdmin" to read an employee's cookie.

Data stored in a visitor/client’s cookie

Token
Description
date_add The date and time the cookie was created (in YYYY-MM-DD HH:MM:SS format).

创建的cookie的日期和时间(在YYYY-MM-DD HH:MM:SS格式)。

id_lang The ID of the selected language.

所选择的语言的标识

id_currency The ID of the selected currency.

所选货币的ID。

last_visited_category The ID of the last visited category of product listings.

产品上市的最后一次访问类的ID。

ajax_blockcart_display Whether the cart block is “expanded” or “collapsed”.

 

购物车块“扩展”或“崩溃”。

viewed The IDs of recently viewed products as a comma-separated list.

最近浏览过的产品作为一个逗号分隔的列表中的ID。

id_wishlist The ID of the current wishlist displayed in the wishlist block.

当前心愿的ID显示在心愿块。

checkedTOS Whether the “Terms of service” checkbox has been ticked (1 if it has and 0 if it hasn’t)

无论是“服务条款”复选框已被选中(1,如果它已经和0,如果它没有)

id_guest The guest ID of the visitor when not logged in.

当未登录的访客的客人ID。

id_connections The connection ID of the visitor’s current session.

访客的本届会议的连接ID。

id_customer The customer ID of the visitor when logged in.

在登录时访问者的客户ID。

customer_lastname The last name of the customer.

客户的姓氏。

customer_firstname The first name of the customer.

客户的名字。

logged Whether the customer is logged in.

客户是否已登录。

passwd The MD5 hash of the _COOKIE_KEY_ in config/settings.inc.php and the password the customer used to log in.

MD5哈希的_COOKIE_KEY_在配置/ settings.inc.php和密码用于登录客户。

email The email address that the customer used to log in.

MD5哈希的_COOKIE_KEY_在配置/ settings.inc.php和密码用于登录客户。

id_cart The ID of the current cart displayed in the cart block.

当前购物的ID显示在购物块。

checksum The Blowfish checksum used to determine whether the cookie has been modified by a third party.
The customer will be logged out and the cookie deleted if the checksum doesn’t match.

 

Blowfish 校验用于确定是否该cookie已经由第三方修改。
该客户将被注销,删除cookie的,如果校验和不匹配。

Data stored in an employee/administrator’s cookie

Token
Description
date_add The date and time the cookie was created (in YYYY-MM-DD HH:MM:SS format).

创建的cookie的日期和时间(在YYYY-MM-DD HH:MM:SS格式)。

id_lang The ID of the selected language.

所选择的语言的标识

id_employee The ID of the employee.

雇员的ID。

lastname The last name of the employee.

员工的姓氏

firstname The first name of the employee.

员工的名字。

email The email address the employee used to log in.

电子邮件地址用于登录的员工。

profile The ID of the profile that determines which tabs the employee can access.

该配置文件确定哪些选项卡中的员工可以访问的ID。

passwd The MD5 hash of the _COOKIE_KEY_ in config/settings.inc.php and the password the employee used to log in.

MD5哈希在配置/ settings.inc.php和雇员使用的登录密码的_COOKIE_KEY_的。

checksum The Blowfish checksum used to determine whether the cookie has been modified by a third party.
If the checksum doesn’t match, the customer will be logged out and the cookie is deleted .

Blowfish 校验用于确定是否该cookie已经由第三方修改。
如果校验和不匹配,则客户将被注销,该cookie将被删除。

 

02 2015-08

 

我要 分享

 

 

本文 作者

 

相关 文章