String startURL = '/PageALanding';
String retUrl =
System.currentPageReference().getParameters().get('retURL');
system.debug('+++++++++++++++++++++++'+returl);
if(retUrl != null){
return Site.login(username, password, retUrl);
}
PageReference pr = Site.login(username, password, startUrl);
System.debug('sjhdfhsdf'+pr);
if (pr == null){
loginError = true;
}
return pr;
apex:pageMessages
in your page because the call adds error messages. In general, add more context to your question.