you can set the success redirect by editing the Authenticate user behavior on the login page.
In the Authenticate user behavior, there is a setting for the success and failure redirect.
There is also a setting for Go To Previous URL (if it exists). If you check this option, you can pass the previous page name as a URL variable in the link to the login page to have that page used as a the success redirect.
to do that, set the login link to use this code:
<a href="login.php?accesscheck=<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">Log In</a>