by Luis de Vasconcelos.
Don't forget to give each of your instances a unique COOKIE PREFIX under Site administration/ Server/ Session handling. I've seen weird things happen when two Moodle instances on one server share the same cookie prefix.