Same problem with missing ability to log in in brand new installation

Started by peterkroman, March 17, 2018, 08:20:27 AM

Previous topic - Next topic

peterkroman

Hi,

A few days ago I had a post regarding that I could not log in to my SMF. Now I have made a brand new implementation of SMF without use of any of the old one, including database.

I have worked with the new implementation for a couple of days, and everything seemed to be working OK. Now I am trying to log in to my site, but I get the exact same message as I did in the old system.

It says something like:
An error has occurred!!

Confirmation of the session failed. Try to log out and then try again.

I might add that I am NOT logged in when I get this message, so the message is rather meaningless??

How do I fix that so that my system gets stabile enough to add users to it??

My new SMF implementation is at the page: https://kroweb.dk/dialog3/

I hope that somebody is able to help me out with this rather quickly, because I am allready getting users on the system, and I really don't want them to experience this.

d3vcho

"Greeting Death as an old friend, they departed this life as equals"

peterkroman

Thanks d3vcho(void),

I am running 2.0.15 and I am looking at the manual installation guide for this version.

Do I replace the code in the section ob_start('ob_sessrewrite'); with this code:
ob_start('ob_sessrewrite');
ob_start(function ($buffer) {
global $context;
if (!$context['user']['is_guest'])
return $buffer;
return preg_replace_callback('~(<form[^<]+action=login2(.+))</form>~iUs' . (!empty($context['utf8']) ? 'u' : ''), function($m) use ($context) {
$repl = '';
if (strpos($m[0], $context['session_var']) === false)
$repl .= '<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"/>';

return $m[1] . $repl . '</form>';
}, $buffer);
});


And if not, where in the section do I copy the above snippet in?

d3vcho

Yes, you would need to find that piece of code and replace with the one you posted above. It should work. Anyway, remember to save a backup of the file in case something brokes up during the process.
"Greeting Death as an old friend, they departed this life as equals"

peterkroman


shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp


shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp


Advertisement: