Redirect to previous page upon login

Hello,

I was wondering if it was possible to have it so when somebody logins on my site it redirects them on the page they were on before upon successfully logging in.

Thanks!