Author |
|
glenelkins Newbie
Joined: 25 August 2020 Location: United Kingdom
Online Status: Offline Posts: 33
|
Posted: 08 November 2020 at 9:09am | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 08 November 2020 at 10:19pm | IP Logged
|
|
|
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 |
|
|
glenelkins Newbie
Joined: 25 August 2020 Location: United Kingdom
Online Status: Offline Posts: 33
|
Posted: 09 November 2020 at 3:21am | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 09 November 2020 at 3:30am | IP Logged
|
|
|
Any chance it's this one?
If so, the issue may be caused by CSRF protection.
--
Regards,
Igor, Afterlogic Support
|
Back to Top |
|
|
glenelkins Newbie
Joined: 25 August 2020 Location: United Kingdom
Online Status: Offline Posts: 33
|
Posted: 09 November 2020 at 4:08am | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 09 November 2020 at 4:15am | IP Logged
|
|
|
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 |
|
|
glenelkins Newbie
Joined: 25 August 2020 Location: United Kingdom
Online Status: Offline Posts: 33
|
Posted: 09 November 2020 at 4:24am | IP Logged
|
|
|
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 |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 09 November 2020 at 4:25am | IP Logged
|
|
|
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 |
|
|
glenelkins Newbie
Joined: 25 August 2020 Location: United Kingdom
Online Status: Offline Posts: 33
|
Posted: 12 November 2020 at 10:38pm | IP Logged
|
|
|
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 |
|
|