Ok, it doesn't work locally since you are opening the files, you need to run it on a server.
The browser will tie the sessions together using the URL (and other internal stuff of course) which is why it works on the whatever server you upload to. This won't work with the file URLs as the browser seems them as different pages from different locations, and so the session isn't shared.
If you set up WAMP or something locally and run it through that, it will work. Which is exactly what xavierm02 suggested.