I watch 'It's me or the dog' on TV and there's a solution that I tried and it worked.
Here goes:
My dog would follow me into the bathroom - no privacy.
So I went into the bathroom and then out again, just opening and closing the door. I did it maybe 20 times and then she stopped bothering to even look in my direction.
Another way is: go into the bathroom and leave the door open - when she comes thorugh the passage, with your body, not your hands or voice, body block her until she is out of the room. Say good girl and go back into the bathroom and start again... 20+ times might be necessary the first time you do it, but it's much less time after time.
the problem with the bathroom is that consistency can be an issue, especially if you rrrreeeally have to go.
I practiced these on my 3/4 mo old shep/lab mix. She almost never goes into the bathroom... with or without me.
Of course this can work or any room or situation. consistency is key... and letting the dog know that she is good for not following you.
Good luck