Opened 3 years ago

Closed 3 years ago

#2453 closed Bug (answered)

Bad request caused by a large number of cookies created by Piwik

Reported by: intellion Owned by:
Priority: normal Milestone: 1.5 - Piwik 1.5
Component: Core Keywords: cookie, bad request
Cc: Sensitive: no

Description

Every time a visitor visits a new page that has Piwik tracking installed a new cookie is created. If the number of such pages per day (before cookies start to expire) comes to a certain limit the visitor starts getting Bad Request page because the header length of the HTTP request becomes too big.

For example we use Piwik to track visitors interactive RE tours (http://seetheproperty.com/1100). Each tour is considered as a separate website. We have thousands of them.
So as an end buyer browses through different tours in the search for a suitable home header length is being increased until the end buyer starts getting Bad Request error.

Attachments (2)

639634.xml (321 bytes) - added by intellion 3 years ago.
screen shot showing Piwik cookies in Chrome
Options - Cookies and Other Data.png (107.7 KB) - added by intellion 3 years ago.

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by intellion

screen shot showing Piwik cookies in Chrome

Changed 3 years ago by intellion

comment:1 Changed 3 years ago by vipsoft (robocoder)

  • Milestone set to 1.5 - Piwik 1.5
  • Resolution set to answered
  • Status changed from new to closed

This isn't a supportable use case because your path ('/1100') is actually a redirect.

The "Bad Request" occurs because each site has its own set of cookies. In normal circumstances, the solution would be to partition the sites by path and use setCookiePath('/1100'). If you're using mod_rewrite, it might be as simple as rewriting the URLs without the [R] flag.

Alternately, there's a plugin in #2371 that can track a site by URL. You would use a single site ID on the client (i.e., a single set of cookies), but on the server, log to separate sites based on the domain in the URL. Feel free to customize it to use the URL path (or a parameter in the query, e.g., order_id). There are some caveats though (described in the ticket).

Note: See TracTickets for help on using tickets.