Skip to content

Store only the listing path in the last listing cookie - #188

Open
boo-code wants to merge 1 commit into
PrestaShop:devfrom
boo-code:fix/listing-cookie-stores-path-only-187
Open

boo-code wants to merge 1 commit into
PrestaShop:devfrom
boo-code:fix/listing-cookie-stores-path-only-187

Conversation

@boo-code

@boo-code boo-code commented Nov 2, 2026

Copy link
Copy Markdown
Contributor
Questions Answers
Description? saveInformationAboutListing() stored the raw REQUEST_URI in the ga_last_listing cookie on every product listing. With a long query string (filter modules, crawlers), the encrypted cookie went over 4096 bytes and Cookie threw "Combined size of name and value cannot exceed 4096 characters" while writing it, after the page was rendered.

Only the path is stored now, capped at 255 characters. HookDisplayFooterProduct uses item_list_url only to check that the product page referer contains it, which the listing path still does.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #187
Sponsor company
How to test? PrestaShop 9.2, category page with a 3,279-character query string. Before: the request logs the exception above (and prints it in debug mode). After: no exception. With a GA account ID set, opening a product from that listing (referer = the long listing URL) still sends item_list_id: "category" and item_list_name: "Category: Clothes", and a product opened from another page sends none.

saveInformationAboutListing() stored the raw REQUEST_URI in the ga_last_listing cookie. With a long query string (listing filters, crawlers), the encrypted cookie went over 4096 bytes and Cookie threw while writing it, after the page was rendered. The path, capped at 255 characters, is enough for HookDisplayFooterProduct to match the product page referer.
@ps-jarvis

Copy link
Copy Markdown

Hello @boo-code!

This is your first pull request on ps_googleanalytics repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

2 participants