Back to forum after logging in

Hi. When someone logs in to the forum in order to post or respond to something, they automatically get taken to the homepage afterwards. How do I change that so they get taken to the forum page that they came from instead?
Thanks
bhomis