Mixpanel Cookie Over HTTPS

By default, Mixpanel cookies send over HTTPS requests as part of the headers. However, Mixpanel’s JavaScript library provides a configuration to prevent the browser from transmitting your cookies with non-https requests.

To do so, use the set_config() method and change the secure_cookie flag from false to true. If you configure your instance to send data over HTTP instead of HTTPS, but do set "secure_cookie: true" then your cookie data will not get sent to the server. 

Using the set_config() method will look like this:


You can also slightly modify your init function in the JavaScript library to the following:



Is this article helpful?
11 out of 16 found this helpful



Article is closed for comments.