Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

SSI is not working for me!

Aloittaja bigdavisc, marraskuu 17, 2013, 06:25:25 IP

« edellinen - seuraava »

bigdavisc

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.

Arantor

* Arantor 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')
Holder of controversial views, all of which my own.


bigdavisc

Subdomain independent cookies is checked and local cookies is unchecked

Arantor

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?
Holder of controversial views, all of which my own.


bigdavisc

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.

Arantor

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)
Holder of controversial views, all of which my own.


bigdavisc

Oh Sorry  ;D

No it is not. it is just a plain .php file

Advertisement: