Tom S. Posted September 3, 2017 Posted September 3, 2017 I'm trying to detect if a user is singed in to the IPS Suite from within the same domain but outside the suite folder. for example: mysite.com/ips vs mysite.com/other So I tried using the following code in the "other" area: /* Require the init.php file from the Community Suite root directory */ require '/path/to/suite/init.php'; /* Initiate the session to verify who this user is */ \IPS\Session\Front::i(); /* Print the user's name */ print \IPS\Member::loggedIn()->name; The account I am testing this with is logged in, but instead of the display name being shown it prints the following: c825n13ac6d715005ab4933d371239e6 And every time I refresh the page is shows a different string. It seems to me that the session isn't being initiated. Side note: If I visit the IPS app and then go back to "mysite.com/other" it shows the display name properly. So it's using the session that was created in mysite.com/ips. However, it needs to work without a user first going to mysite.com/ips. Thank you for any assistance. EIDT: I think it might be because the "other" section cannot access the ips4 cookies as they are set under a different path. Could that be the problem?
Tom S. Posted September 3, 2017 Author Posted September 3, 2017 Got it working. Just had to change the path of where the cookies were being stored using the constants.php file.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.