fixed login problems with SSL
many changes and fixes with move to production