Redirect also when already logged in (cookie) ? | Peter's Login Redirect | Forum
Back to the login redirect plugin page
7:32 am
Hi, thanks for that great plugin.
I'm wondering how to get the plugin also work when accessing the website as an already logged in user ?
Imagine you login to my website. The cookie is set up... You come back next time but you are not redirected where I want you to go, instead you go directly to the page you were asking for (usually homepage or bookmarked page).
How can I force you to be redirected to a given URI ?
Thanks.
You could hook into the plugin logic by using redirect_wrapper() or redirect_to_front_page() in your template. However, this would cause unexpected behavior: you wouldn't be allowing users to go where they're expecting to go. Plus, you might have to consider triggering such a redirect only once per user session.