How to generate the COOKIEHASH from JavaScript

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com
QUẢNG CÁO: Đổi thẻ cào thành tiền mặt min rút 10k tại đây

How do I get the contents of the PHP-variable: COOKIEHASH inside a Cypress-test.

I’m writing some Cypress-test for WordPress, and in order to set the cookies to log in a user in WordPress using Cypress, then I need the contents of the COOKIEHASH-variable.

For those not familiar with the COOKIEHASH, go to a WordPress-installation and put in this code anywhere:

And then you’ll see it. It looks something like this: a8b94154380982c3284a467b8aa224c6.

When I run my Cypress-tests for the first time, then I don’t know what that hash is, so I don’t know which cookies to set.

So currently I log in manually, go to cookies in my browser and get the hash. Which is quite the manual operation for automated tests. 🙂

If I hash zeth.dk, then the js-md5-hash gives me: 8aa4b9bbc2a9e946b670fd8372a3081a
and I can see in my cookies that the hash is: b7d8d5a26884619e3b3b4481ba778642

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com