Set the redirect for both after login and logout to the previous page, homepage, cart, checkout, shop, or any custom page of your choice.