Login Button Redirect

I want to allow members to log in on page A and after successfully logging in, be automatically redirected to page B. If they’re already logged, in they would go directly to page B on their browser. Just starting out and I need the code for this…in it’s entirety if possible. Thanks in advance for any help you can provide!