Jump to content

single sign-on session not initiating

Featured Replies

Posted

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?

  • Author

Got it working. Just had to change the path of where the cookies were being stored using the constants.php file.

 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.