Redirect the users to the page they were watching before logging in or registering an account
I hope you want to keep users on the currently visited page after logging in or out. If it is so, then download and install the Login Destination module. It is also possible to keep users on the currently visited page after logging in or out.