News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

SSI Login Redirect Problem

Started by T D, December 30, 2015, 12:56:45 AM

Previous topic - Next topic

T D

Hello there, I am having some issues with the SSI login redirect.  I have a market style page where a user can login (instead of navigating to the forums and logging in and then having to navigate back). On my test site from ages ago (6 months or so), this is all working as intended.

However, I recently decided to dumb down the page to have a different use (in this case to serve as a verification page, but that doesn't seem relevant here). Now, when I login on this page, I get redirected page to the forum index instead of remaining on this external page.  Alongside this, when I logout, I remain on the page just fine.

I cannot, for the life of me, remember what I modified when I previously did this, except that it took me hours to get working (which is probably shouldn't have...); there are no modifications installed on the forums.

I do remember thinking it had something to do with login ignoring the $_SESSION['login_url'] or at least resetting it.

The current code (matches the working test site exactly, and it matches when this was running on an actual host)
echo '<li><a href="'.$forums.'">Forums</a></li>';
if (!$context['user']['is_guest']) {
$_SESSION['logout_url'] = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
echo '<li>'.ssi_logout().'</li>';
}
echo '</ul>';
if ($context['user']['is_guest']) {
echo '<div class="login">';
$_SESSION['login_url'] = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
echo ssi_login();
echo '</div>';


Please let me know if you need more information; thank you.

T D

I am unable to modify my post, so I guess I have to respond here. I don't know if it was my computer refusing to properly clear cache and cookies, or if something just randomly started to work, but on mobile I can login on the page just fine without redirect. Will leave the topic unsolved until I return home to retest on my computer.

Advertisement: