Bartosz Olchówka

Setting Cookies to Subdomains in JavaScript

We've recently faced a problem of setting a cookie from foo.mycompany.com to all subdomains in a *.mycompany.com domain.

The solution seemed pretty straightforward: just set a wildcard cookie to .mycompany.com (note that the first character is a dot). However, we had to determine the target domain (the actual value of “.mycompany.com”) automatically because our code is fired on tens of thousands of different domains.

And here came the problem: the list of Top-Level Domains.

How We Connect Our Apps to Dev Environments

One of the most annoying drawbacks of developing desktop and mobile apps is the inability to switch between dev and production environments. When a client tells us about a problem with the app, our developers can’t reproduce the problem using the same app that is used by the customer. Fortunately, we found a neat solution. We hard-code dev & production servers’ addresses inside the app that is released to customers. Then, depending on the platform, we use one of the tricks that tells the app to connect to the dev environment.