Hi I have just installed SMF and I want it to work properly.
I want my users to go to a page that either direct them to a login page if they are not logged it to my forum. and will redirect them to a different page if they are logged in.
I have tried this code:
<?php
include ('../forum/SSI.php');
if ($context['user']['is_guest']) {
ssi_login();
}
else {
//Redirect Goes Here
}
?>
But no matter whether I am logged in or not I will be directed to the Login Form
Please Help.
/me assumes you're using SMF 2.0.6
What's the setting of Admin > Configuration > Server Settings > Cookies and Sessions > Enable subdomain independent cookies? (Or for that matter, same page, 'enable local cookes')
Subdomain independent cookies is checked and local cookies is unchecked
Hmm, that seems like it should be correct. Did you change those settings at any point? (If so, log out and log back in to ensure your cookie gets rebuilt)
Also, where did you put that code exactly?
I did not change these settings.
This code is in a file on a subdomain. The forum is stored on a different subdomain on the same server.
That wasn't what I meant... you've made a file. Is that file inside something else (e.g. embedded inside WordPress whose cookie handling is well known to damage anything else)
Oh Sorry ;D
No it is not. it is just a plain .php file