BrainCMS Logout Not Working

Lasers

Member
Nov 28, 2014
62
1
I've been searching for 2 days now and I cant seem to find the solution to this. When setting up BrainCMS (with PlusEmu) on a local pc, the logout button works perfectly, however when I make the same exact hotel on my VPS the logout stalls the /me page and essentially just reloads it. This makes logout impossible unless you clear your cache. Has anyone come across this issue and figured it out? Thanks for the help!

Code for logout.php:
Code:
<?php
    session_destroy();
    $_SESSION = array();
    header('Location: '.$config['hotelUrl'].'/index');
?>
 

Khalil

IDK
Dec 6, 2011
1,642
786
1. You're destroying the temporary session data and then redefining $_SESSION as an empty array.
2. Always kill the page after issuing a redirect, otherwise, you leave yourself open to a rather serious security vulnerability.

PHP:
// Have PHP load the current active session.
session_start();

// Clear the session array.
$_SESSION = array();

// Destroy the temporary session data stored on the disk.
session_destroy();

// Issue a redirect.
header ("Location: /");

// Kill the page.
die; // or exit(); - functionality-wise, they're the same.
 
Last edited:

Lasers

Member
Nov 28, 2014
62
1
1. You're destroying the temporary session data and then redefining $_SESSION as an empty array.
2. Always kill the page after issuing a redirect, otherwise, you leave yourself open to a rather serious security vulnerability.

PHP:
// Have PHP load the current active session.
session_start();

// Clear the session array.
$_SESSION = array();

// Destroy the temporary session data stored on the disk.
session_destroy();

// Issue a redirect.
header ("Location: /");

// Kill the page.
die; // or exit(); - functionality-wise, they're the same.

Thanks for the reply mate, I tried that code and all it does it bring me to a blank logout page and if I type in the link again I am just redirected to the /me page.
 
Last edited:

Khalil

IDK
Dec 6, 2011
1,642
786
Thanks for the reply mate, I tried that code and all it does it bring me to a blank logout page and if I type in the link again I am just redirected to the /me page.

Probably should have made it clear that you weren't supposed to copy/paste that code because it starts a new session altogether. You're probably looking for this:

PHP:
session_destroy();
header("Location: /index");
exit();
 

Lasers

Member
Nov 28, 2014
62
1
Legit still brings me to a blank /logout page, doesn't redirect to index or anything. Am I doing something wrong here?

zkrPLfy.png


Probably should have made it clear that you weren't supposed to copy/paste that code because it starts a new session altogether. You're probably looking for this:

PHP:
session_destroy();
header("Location: /index");
exit();
 

Khalil

IDK
Dec 6, 2011
1,642
786
Code:
session_destroy();
header('Location: '.$config['hotelUrl'].'/index');
exit();
That's the exact same code I gave him, it won't even execute a redirect, much less destroy the session.

I looked around and it seems plenty of people are having similar "unsolvable" issues with this particular application; should probably just dump it and go for something more reliable.
 

Lasers

Member
Nov 28, 2014
62
1
Code:
session_destroy();
header('Location: '.$config['hotelUrl'].'/index');
exit();

Still doing the same thing, could it be because of my SSL Cert?
1Q9tqod.png

Post automatically merged:

That's the exact same code I gave him, it won't even execute a redirect, much less destroy the session.

I looked around and it seems plenty of people are having similar "unsolvable" issues with this particular application; should probably just dump it and go for something more reliable.

Ye this issue seems to be happening all over the place. Do you know of any good cms's that work well with PlusEMU and aren't exploitable like RevCMS or maybe a RevCMS that has exploits fixed?
 

Khalil

IDK
Dec 6, 2011
1,642
786
Still doing the same thing, could it be because of my SSL Cert?
Unless you're having similar problems with the login and registration, no. Is "BrainCMS" a must for you? If not, I recommend switching to something more tried and tested, there's something properly fucked up with this one.
 

Lasers

Member
Nov 28, 2014
62
1
Unless you're having similar problems with the login and registration, no. Is "BrainCMS" a must for you? If not, I recommend switching to something more tried and tested, there's something properly fucked up with this one.

Ye that's what I've been thinking lmao, I sat here for 2 days thinking "what the fuck is wrong" and legit nothing worked. Glad to see I'm not the only one that thinks there is something fucked with brain. Could you by any chance push me towards a "tried and tested" cms release?
 

n4te

zzz
Oct 27, 2014
669
293
Ye that's what I've been thinking lmao, I sat here for 2 days thinking "what the fuck is wrong" and legit nothing worked. Glad to see I'm not the only one that thinks there is something fucked with brain. Could you by any chance push me towards a "tried and tested" cms release?


use rev if ur new to retros honestly
 

Users who are viewing this thread

Top