• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Check if someone is logged in and redirect on non-xenforo page

#1
Is there a way to see whether someone is logged in and, if so, redirect them to the forums?

The reason I ask is because I use a static HTML page as my domain's landing page, with the option to login or register (eg www.mydomain.com/index.html). However, I'd like to check if someone is already logged in, and automatically redirect to www.mydomain.com/forums/ using perhaps a javascript location.replace command.

How can I check whether someone is already logged in from outside the system itself?
 

Mike

XenForo developer
Staff member
#2
There isn't really a way to do this from outside the system (allowing it would potentially create a security issue).
 

Mike

XenForo developer
Staff member
#4
There isn't a way to be 100% correct from just a cookie, but you can look for the presence of a xf_user cookie if the user has chosen to stay logged in.