Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: ral - joulukuu 01, 2019, 05:24:42 IP

Otsikko: Log in and out session problem on other site.
Kirjoitti: ral - joulukuu 01, 2019, 05:24:42 IP
Hi,
I've been a long time user of SMF and have been searching this issue and reading threads but haven't found a solution.

It's down to the ssi_login and ssi_logout session issue that appeared in 2.0.14 (from what I remember) and was supposidly fixed in 2.0.15.

When logging in from my site's forum it's fine www. domain. com/ forum, but when i log in from the form on a page in www. domain. com (using the ssi_login function), and yes SSI.php is included, I get "Session verification failed. Please try logging out and back in again, and then try again.".

When logged in I can see that $context['session_var'] and $context['session_id'] return different values that what is present on the forum logout link.

The forum is a clean install.
I have "Use subdomain independent cookies" on.

Any suggestions?
Otsikko: Re: Log in and out session problem on other site.
Kirjoitti: Arantor - joulukuu 01, 2019, 05:37:27 IP
Local cookies turned on?
Otsikko: Re: Log in and out session problem on other site.
Kirjoitti: ral - joulukuu 01, 2019, 05:54:00 IP
Local storage of cookies? It's off.
Otsikko: Re: Log in and out session problem on other site.
Kirjoitti: Arantor - joulukuu 01, 2019, 06:00:43 IP
Would you be able to post a link so someone can look at it? This is a bit weird (and depending on what you've done, more work may be required)
Otsikko: Re: Log in and out session problem on other site.
Kirjoitti: ral - joulukuu 01, 2019, 06:16:04 IP
Which would you like the link to?
The website is www. batman-online. com/index.php

It's currently being built up again.
Otsikko: Re: Log in and out session problem on other site.
Kirjoitti: Arantor - joulukuu 02, 2019, 03:43:26 IP
Is that homepage your custom code? Do you happen to run session_start() in it? (If so, please take it out, SMF is making 2 sessions here, which is weird but if you're doing things like manually starting session before SMF gets to it, or even after SSI is loaded, weird things will happen.)
Otsikko: Re: Log in and out session problem on other site.
Kirjoitti: ral - joulukuu 02, 2019, 04:39:52 IP
That was the problem. Thank you Arantor!

I've set $_SESSION['login_url'] and $_SESSION['logout_url'] with the same value (https:// www. batman-online .com'.$_SERVER['REQUEST_URI']) - however logging in goes directly the forum whereas loggin out take the user to the correct page.

Anything I'm doing wrong for the logging in?
Otsikko: Re: Log in and out session problem on other site.
Kirjoitti: Arantor - joulukuu 02, 2019, 04:59:20 IP
Off hand I can't see why that would be wrong, that's weird.