Hi Alex,
I tested the two solutions with Joomla / Facebook / Google+ Login/Logout on SCLogin Module
first solution:
$url = $uri->toString(array('port', 'path', 'query'));All Logins /Logouts keep me on the same page as I set.
second solution:
$url = '/' . $uri->toString(array('port', 'path', 'query'));- on Joomla Login redirect me on the same page, but return an error because loose the domain in URL
- on Joomla / Facebook / Google+ Logout still bring me to the home page
So, I assume the first solution is the right one

(you can still check on the same test site with same credentials) - PS Many Thanks for help
Please, Is this a final fix ? (Valid for all situations) or just in my case, because I'm still using /index.php/ in my URLs