Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: API login error, direct logout Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Yamakasi
Newbie
Newbie


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 3:20am | IP Logged Quote Yamakasi

I'm testing the API for Afterlogic which have been working in the past but I see some strange error at the moment:

Error on line 577 in file /my/path/to/afterlogic/common/managers/integrator/manager.php

This is the @setcookie line here:

Code:

     public function SetAccountAsLoggedIn(CAccount $oAccount, $bSignMe = false)
     {
          $aAccountHashTable = array(
               'token' => 'auth',
               'sign-me' => $bSignMe,
               'id' => $oAccount->IdUser
          );

          $iTime = $bSignMe ? time() + 60 * 60 * 24 * 30 : 0;
          $_COOKIE[self::AUTH_KEY] = CApi::EncodeKeyValues($aAccountHashTable);
          @setcookie(self::AUTH_KEY, CApi::EncodeKeyValues($aAccountHashTable), $iTime, $this->getCookiePath(), null, null, true);
     }


What can go wrong here ?
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 20 July 2017 at 3:22am | IP Logged Quote Igor

What's the exact error recorded in PHP logs?

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


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 4:32am | IP Logged Quote Yamakasi

Hi Igor, I don't see anything logged in the PHP logs about it. I'm logging ALL!
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 20 July 2017 at 5:06am | IP Logged Quote Igor

Are you running the latest version 7.7.5 of WebMail Lite PHP?

You can determine the version number as described here.

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


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 20 July 2017 at 5:07am | IP Logged Quote Igor

Also, try removing @ character prior to setcookie and see if there's any more verbose debug info in the logs.

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


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 5:51am | IP Logged Quote Yamakasi

I'm still on an old version, 7.2.1

I tried that as well, no detailed error information. I'm pretty clueless there.
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 20 July 2017 at 5:58am | IP Logged Quote Igor

Well my only guess at the moment is that, somewhere before setcookie call, some output is sent to the browser - and setcookie, just like any other case of sending headers, requires that there's no output done prior.

Other than that, can't really suggest anything else without error specifics.

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


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 6:35am | IP Logged Quote Yamakasi

Hi, you might be right there.

I upgraded to the latest version and now I get a session variable back from:

Code:

$apiIntegratorManager->SetAccountAsLoggedIn($account)


After this nothing is done, I don't redirect webmail yet, I set my other sessionvariables for my app and login to my app, I enter my webmail lateron manually.

This actually worked before.
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 20 July 2017 at 6:39am | IP Logged Quote Igor

From your last message, not really clear to me - does the issue still occur, or the error is gone?

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


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 7:16am | IP Logged Quote Yamakasi

The logout still happens indeed, only of the webmail, my app is OK.
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 20 July 2017 at 7:18am | IP Logged Quote Igor

I'm sorry, the logout? Can you describe the issue in more detail, what exactly you're doing and what errors (if any) you see?

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


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 7:29am | IP Logged Quote Yamakasi

OK, the logout is more an message from (this) imap test server, I see it also happening when I run the same afterlogic install using a subdomain. What I do see happening is that the working subdomain version does not work as a relative path in my app, I get a blank screen when I load it in my iframe. I'm not able to reproduce that as I think I seen it before, any idea ?

OK, fixed! I needed to update my static JS files! Thanks for the fast reply Igor, you are fast these days!!
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Yamakasi
Newbie
Newbie


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 7:46am | IP Logged Quote Yamakasi

Igor are you able to tell me what keeps the user logged in ? what is stored where with Afterlogic as I don't see any SESSION variable, only a cookie ?
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 20 July 2017 at 7:52am | IP Logged Quote Igor

PHP sessions are only used in AdminPanel. As for main frontend of WebMail, p7auth cookie is used for that purpose. Thus, deleting the cookie effectively logs user out.

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


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 20 July 2017 at 7:58am | IP Logged Quote Yamakasi

OK, clear but how would that works when I loadbalance the webmail app between two backend servers, how do they know of each other the session exists ?

Is there something stored in the database ?
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 21 July 2017 at 1:54am | IP Logged Quote Igor

No idea really, sorry, answering that would require involving the developers. If you're interested in getting consultancy services directly from our team, please contact us via HelpDesk. Thank you.

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


Joined: 11 November 2013
Online Status: Offline
Posts: 13
Posted: 21 July 2017 at 3:16am | IP Logged Quote Yamakasi

Thanks, I don't need consulanty I just need to know how afterlogic handles it's sessions internally.

Could be in the docs somewhere.
Back to Top View Yamakasi's Profile Search for other posts by Yamakasi
 

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