added some debug messages to show when developer is enabled, fixed some problems with cookiedomain/session detection, and fixed php < 5.5 compatability