Replace depreacted mysql function and detect if EDD USE PHP SESSIONS is enabled. #2081