• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Issue logging out

Status
Not open for further replies.

JJUK

Chevereto Member
Website URL
<private>

Chevereto version
3.10.10

Description of the issue
Hi

I'm having an issue with the script. I've changed server recently and although everything seems to be working ok. There's one thing that isn't working as it used to.

When I click logout the script doesn't take me back to the main page. It's like the page cannot be found anymore and the browser's default "Page cannot be found" screen comes up.

I've created a totally new installation and everything works fine, but as soon as I connect the old database to the new installation the issue is back.

Can you advise please?
 
Could be just a session issue, clear your cookies. If persists, then check if you have session cache or something like that.
 
Hi

It happens on more than one device and no I don’t have a session cache.

I’ve just tried it again on my phone and included the page it goes to once you click logout
 

Attachments

  • 474C8600-AB1E-488A-9557-C558E6DE0805.jpeg
    474C8600-AB1E-488A-9557-C558E6DE0805.jpeg
    111.2 KB · Views: 4
I tested your website and I got the redirect loop. The redirector in /logout route:

PHP:
$route = function($handler) {
    try {
        if(!$handler::checkAuthToken($_REQUEST['auth_token'])) {
            $handler->template = 'request-denied';
            return;
        }
        if(CHV\Login::isLoggedUser()) {
            CHV\Login::logout();
            unset($_SESSION['last_url']);
            G\redirect(G\get_current_url());
        } else {
            $handler::setVar('pre_doctitle', _s('Logged out'));
        }
    } catch(Exception $e) {
        G\exception_to_error($e);
    }
};

/logout It issues a redirect to G\get_current_url() (loop).

This means that CHV\Login::logout() isn't working but isn't throwing an exception either (that's why the code keeps running in a loop). The logout method (CHV\Login::logout) revokes several session values, so my guess is that PHP isn't capable of doing that or the updated session values are not being read on the next request.

Sessions are one of the most annoying stuff that always fails when you don't configure it properly. Sadly, at script side I can't detect 100% of all the possible session issues out there. I just can't, PHP can only read/write it doesn't know if the value is cached properly or not. It doesn't know if the new values will be propagated fast enough for the next call and so on.

The system does plenty session checks, in fact, the system checks for session cache issues but like I said, the script layer is scoped to whatever the server throws at runtime and if the server says "A" PHP understands "A".

In any case, you can test if the problems are sessions by simply injecting a new session save path under app/settings.php as is described here (look where it reads "Settings hacks"). Just put an absolute path under your public folder so sessions won't be stored in /tmp (or the default path configured by your server administrator).
 
Thank you for your reply.

I've attempted to see if it is the sessions as stated above and amended the tmp folder location. The problem still occurs.

But as mentioned above. This does not happen if I reinstall a fresh script. It only happens when I link the old mysql database to a new fresh script. What is the best way of transferring all accounts, pictures etc over to a new mysql database without loss of users, pictures etc?
 
The same way in which you backup any script in any web server. Mysql dump and rsync.
 
That’s what I did with the original backup that I’m using. Which is having the problems, so I want to merge the old database with a new one without copying over whatever is causing the problem.
 
Status
Not open for further replies.
Back
Top