Jump to content

single sign-on session not initiating


Tom S.
 Share

Go to solution Solved by Tom S.,

Recommended Posts

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?

Edited by Tom S.
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...