Anyone who develops Javascript long enough undoubtedly runs into difficulties involving the various security features all browser vendors implement. These security features are a good thing — they protect us from malicious users hijacking our browsing experience. But they can certainly cause some headaches. The security feature that presents the most difficulty for us as developers is the same origin policy.

In a nutshell, this policy prevents pages from two different domains from modifying each others properties, using XMLHttpRequest, setting cookies etc. For instance, Example.com and OtherExample.com can’t get references to each others document properties and can’t set cookies on each other. Additionally, Example.com can’t use XMLHttpRequest (aka AJAX) to load a resource from OtherExample.com. This last bit is probably the biggest issue for developers today — in todays world of open web services and mashups. How do you consume a web service with Javascript if you can’t load the data properly? Read the rest of this entry »

Today I want to talk about daemonizing PHP scripts on Linux servers — creating scripts that are meant to run in the background for long periods of time. After we’ve covered that, I’ll explain how I like to use supervisord to manage these long-running PHP processes.
Read the rest of this entry »