Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Keeps saying i have to re-login? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
glenelkins
Newbie
Newbie


Joined: 25 August 2020
Location: United Kingdom
Online Status: Offline
Posts: 33
Posted: 08 November 2020 at 9:09am | IP Logged Quote glenelkins

Having another issue, we have our custom login code with php which works which is embeded in an iframe, but on some machines it keeps showing a box saying i need to log out and back in?

I don't want it to keep doing this, the whole point of redirecting it to a php program in iframe is so it auto logs in. I have also made the cookie config in the json files 3 years, so not sure what's happening?

Back to Top View glenelkins's Profile Search for other posts by glenelkins
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 08 November 2020 at 10:19pm | IP Logged Quote Igor

Quote:
on some machines it keeps showing a box saying i need to log out and back in


Can you post the exact message, please? Thank you.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
glenelkins
Newbie
Newbie


Joined: 25 August 2020
Location: United Kingdom
Online Status: Offline
Posts: 33
Posted: 09 November 2020 at 3:21am | IP Logged Quote glenelkins

Igor wrote:
Quote:
on some machines it keeps showing a box saying i need to log out and back in


Can you post the exact message, please? Thank you.

--
Regards,
Igor, Afterlogic Support


That's difficult because it doesn't happen constantly
Back to Top View glenelkins's Profile Search for other posts by glenelkins
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 09 November 2020 at 3:30am | IP Logged Quote Igor

Any chance it's this one?



If so, the issue may be caused by CSRF protection.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
glenelkins
Newbie
Newbie


Joined: 25 August 2020
Location: United Kingdom
Online Status: Offline
Posts: 33
Posted: 09 November 2020 at 4:08am | IP Logged Quote glenelkins

https://ibb.co/qpT2jB6

There is a screenshot, it just seems to happen randomly. It seems be to do with a user conflict, which is confusing as it doesn't happen all the time.

The code we use for logging in is...

<?php

require_once './system/autoload.php';

$username = isset($_GET['username']) ? $_GET['username'] : null;
$password = isset($_GET['password']) ? $_GET['password'] : null;
$doLogout = isset($_GET['doLogout']) ? $_GET['doLogout'] : 'no';


if($username && $password) {
    \Aurora\System\Api::Init();
    
    $aData = \Aurora\System\Api::GetModuleDecorator('Core')->Login($username, $password);
    if (isset($aData['AuthToken'])) {
       
        @\setcookie(
            \Aurora\System\Application::AUTH_TOKEN_KEY,
            $aData['AuthToken'],
            \strtotime('+10000 days'),
            \Aurora\System\Api::getCookiePath(), null, \Aurora\System\Api::getCookieSecure()
        );


        \Aurora\System\Api::Location('./');

        exit();
    }
}

header('HTTP/1.0 403 Forbidden');

echo 'You are forbidden!';

exit();
Back to Top View glenelkins's Profile Search for other posts by glenelkins
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 09 November 2020 at 4:15am | IP Logged Quote Igor

That would happen if you have multiple tabs open in the same browser - with different users logged in different tabs. Also, if you have WebMail open in multiple tabs, logging out of user account in one of the tabs would result in such a message shown in other tabs where you were logged into that account.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
glenelkins
Newbie
Newbie


Joined: 25 August 2020
Location: United Kingdom
Online Status: Offline
Posts: 33
Posted: 09 November 2020 at 4:24am | IP Logged Quote glenelkins

Igor wrote:
That would happen if you have multiple tabs open in the same browser - with different users logged in different tabs. Also, if you have WebMail open in multiple tabs, logging out of user account in one of the tabs would result in such a message shown in other tabs where you were logged into that account.

--
Regards,
Igor, Afterlogic Support


Is there any way to prevent it? It's a little unhelpful. Each account is displayed in an iframe if that helps.
Back to Top View glenelkins's Profile Search for other posts by glenelkins
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 09 November 2020 at 4:25am | IP Logged Quote Igor

There currently isn't one as the cookie is browser-wide. Hence - one browser, one WebMail user session.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
glenelkins
Newbie
Newbie


Joined: 25 August 2020
Location: United Kingdom
Online Status: Offline
Posts: 33
Posted: 12 November 2020 at 10:38pm | IP Logged Quote glenelkins

Igor wrote:
There currently isn't one as the cookie is browser-wide. Hence - one browser, one WebMail user session.

--
Regards,
Igor, Afterlogic Support



I got around the issue by having sub domains pointing to the mail system and then setting the cookie domain specifically for each account in the iframe for that sub domain.
Back to Top View glenelkins's Profile Search for other posts by glenelkins
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide