To replicate:
Fresh install. Place the following in Page::init().
var_dump(Session::get_all());
Session::set('testVariable', 'testValue');
Visit a page on the site, without logging in and WITHOUT visiting /admin.
The expected result of this (after loading the page twice) would be to see a dump of session data containing testVariable => testValue
Instead it seems that any data stored in the session does not persist between requests. Unless /admin has been visited. Visit /admin, then do the check again...
So something happens when /admin is visited that kicks Session into persisting.
This does not seem to be an issue on all hosting environments... however, 3/4 that we have tested on do have this issue. Two of these are running PHP 5.4, the other two PHP 5.6.
This does not seem to be an issue specific to any SS version, we've tested 3.0.5, 3.2, 3.4.0
I've submitted an issue against silverstripe-framework on github, but any insights would be valuable as we have a site in the wild that is broken because of this, any clues/fix/patch/hack/workaround would be great.