Because overall her personality is friendly I then have to wonder if even though she seems to love people, she is still not 100% comfortable to allow them their own terms on giving her attention. I would say it is very important to be able to read her body language and it seems when you may be able to already recognize when she might act out as you said you keep her away from situations where it may happen.
In both instances she was being pet and in your son's instance she sought it out intitially , in your instance she may have been seeking it out but then you stopped petting and restarted on your own, possibly when she thought it was done. In your son's case he was petting then went to move to a different area assuming she wanted to be pet.
She is 5 years old now and this started 2 years ago, so health wise even though she has had a checkup I would want to see a thyroid screening done as if the thyroid is off even a little there can be sudden aggressive behaviors. So if this has not been done, and a full thyroid panel not a partial, I would look into this.
The other thing is that dogs go through changes from ages neo natal to four years old and it is how we handle those changes that can determine at least some of the outcome of what we see in a dog as it matures.
You mention that she is not easy going over other dogs, her hair stands up and she barks. this can be the sign of an alpha dog or a fear aggressive dog that only feels relaxed in situations where she knows what is going to happen next. If this is the case she is likely to go after someone again if something happens she is not expecting.
I would strongly suggest that you have a reputable trainer/behaviorist in your area give her a temperament test to accurately read her, as dogs that are often outgoing and friendly with people are like this with other dogs and will not do sneak attacks of the people they live know. So she may be the most wonderful happy dog in situations she can predict, but not so in situations she cannot predict.