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:

mixpanel.set_config({"secure_cookie":true});

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

mixpanel.init("yourTokenHere",{"secure_cookie":true});

 

Is this article helpful?
7 out of 10 found this helpful

Comments

0 comments

Article is closed for comments.