News:

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

Main Menu

$_SESSION['login_url'] / logout does not redirect you correctly

Started by Remi-X, January 27, 2012, 04:09:57 AM

Previous topic - Next topic

Remi-X

So, we're doing a site with some SMF integration but we found a problem. We made our own login form on our website using SMF functions. Now, we are using $_SESSION['login_url'] and $_SESSION['logout_url'] to redirect the user back to our main site, by getting the current URL the user is on.

Now that looks all fine, but SMF does not redirect us to the wished URL unless the $_SESSION variable is called twice (So, that means, also visiting another page calling $_SESSION too). We also tryed a static redirect page which caused the same problem. Is there anything we can do to this or is this an SMF bug?

Forum version: 2.0.1.


floridaflatlander

#2
How do you define $_SESSION['login_url'] & a cookie isn't accessible until the setting page is reloaded or another page is accessed. Could this be the problem

Remi-X

Yes that could be a problem, but I have no clue how I can properly fix this. Anyone?

danwsc

I used the provided redirects.
That seemed to work for me.


    myssi_login($_SERVER['REQUEST_URL'], 'echo');
    myssi_logout_post($_SERVER['REQUEST_URL'], 'echo');


myssi_? is just a little cosmetic modification of ssi_?

Advertisement: