Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SuiteCRM Forces webERP Logout (NOT a webERP or SuiteCRM issue)
03-14-2018, 01:18 AM, (This post was last modified: 03-26-2018, 11:34 AM by TurboPT.)
#1
SuiteCRM Forces webERP Logout (NOT a webERP or SuiteCRM issue)
This may not be a webERP issue but I figured I'd ask...

When logged into webERP if I open our SuiteCRM main login web page I am forced out of webERP and I have to perform another webERP Login.

This happens even if I do NOT perform a Login in SuiteCRM. All I need to do is open the URL and I am kicked out of webERP.

I assume this is some sort of session issue but as I am a PHP novice I have no idea where to start so any help is greatly appreciated!

Both sites are hosted on the same ClearOS server.
Setting this in config.php prevents me from being kicked out of webERP if I open the SuiteCRM URL:

$SessionSavePath = '/var/www/html/weberp/session'

However... If I perform a SuiteCRM login I am still kicked out of webERP...
So now...

With $SessionSavePath set I still get kicked out of webERP if I hit SuiteCRM URL but...

If I perform a SuiteCRM login and THEN perform a webERP login all is well but...

If I perform a SuiteCRM logout I still get kicked out of webERP...

Any ides on this one???
https://www.linkedin.com/in/eclipsepaulbecker
Reply
03-14-2018, 03:03 AM, (This post was last modified: 04-01-2018, 05:11 AM by TurboPT.)
#2
RE: SuiteCRM Forces webERP Logout
(03-14-2018, 01:18 AM)VortecCPI Wrote: This may not be a webERP issue but I figured I'd ask...
...
Both sites are hosted on the same ClearOS server.

Both apps hosted simultaneously on the same server are very likely using the SAME default session name reference.
(in this case PHPSESSID, or whatever is set within php.ini as the session.name)

In session.php, try this for a test:

(around line 37, note the last two comments in this example)
PHP Code:
session_write_close(); //in case a previous session is not closed
ini_set('session.cookie_httponly',1);  // you might not yet have this line
session_name('PHPSESSIDERP'); // add this line, only appends 'ERP'
session_start(); 

Then, log out of both apps, login to each, and I believe that the apps should retain independent sessions.
However, I don't know if this name will be specifically be kept for webERP (as this situation would likely be a corner-case for many), and I'd have to confer with others.

You can also check the cookies in the browser's debugger to verify that both names appear (PHPSESSID, PHPSESSIDERP) after having logged-in to both apps after the change.
Reply
03-14-2018, 04:28 AM, (This post was last modified: 03-14-2018, 04:30 AM by VortecCPI.)
#3
RE: SuiteCRM Forces webERP Logout
Paul,

BRILLIANT and thank you so much!!!

I was even able to remove the $SessionSavePath setting in config.php.

Now both web apps work at the same time and there are NO conflicts.

This started out as a small thorn in my side but has been getting bigger and bigger over time.

It is so nice to be able to ask an expert in here and get an actual working answer!!!
https://www.linkedin.com/in/eclipsepaulbecker
Reply
03-14-2018, 04:42 AM, (This post was last modified: 04-01-2018, 04:59 AM by TurboPT.)
#4
RE: SuiteCRM Forces webERP Logout
(03-14-2018, 04:28 AM)VortecCPI Wrote: ...
It is so nice to be able to ask an expert in here and get an actual working answer!!!
Also, logging out of one app should not affect the other as well.

Well, I'm still working on my PHP "expert-ness", which I'm sure will be ever ongoing as far as most other programming things go. I come from an embedded C background, mostly, but I ran into a similar issue with two other PHP open source apps about 10-15 years ago. Two apps on the same machine were setting the same session variable name (both apps happened to set $_SESSION['userid']), so one app 'clobbered' the other when used at the same time, on the same machine. Back then, though, (as far as I recall) the sessions were not properly destroyed, so we were able to simply change the session variable name in one of the apps (i.e. $_SESSION['user_id']) to avoid the trouble as there were no other session variable name conflicts, just the one.
Reply
03-30-2018, 09:50 PM, (This post was last modified: 03-30-2018, 09:54 PM by VortecCPI.)
#5
RE: SuiteCRM Forces webERP Logout (NOT a webERP or SuiteCRM issue)
BUMP...

Is this change something we want to incorporate into the main trunk so others do not encounter this issue?
Does it conform and work with the new logout.php script?
https://www.linkedin.com/in/eclipsepaulbecker
Reply
03-30-2018, 11:07 PM,
#6
RE: SuiteCRM Forces webERP Logout (NOT a webERP or SuiteCRM issue)
I have been using this for a couple of weeks and seen no down side so I would definitely say it should be included. I know Paul ahas been busy on other things so I guess he will commit when he gets the chance.

Tim
Reply
03-31-2018, 05:01 AM,
#7
RE: SuiteCRM Forces webERP Logout (NOT a webERP or SuiteCRM issue)
Thank you!
https://www.linkedin.com/in/eclipsepaulbecker
Reply
04-01-2018, 02:35 AM, (This post was last modified: 04-01-2018, 03:22 AM by TurboPT.)
#8
RE: SuiteCRM Forces webERP Logout (NOT a webERP or SuiteCRM issue)
Any proposals on what name should be used?

It honestly does not matter to me, but as a few potential examples:

webERPapp
webERP-team // matches the GitHub name (assuming that I can use the hyphen, at least -- not tested)

PHPSESSIDwebERP
PHPSESSID_webERP
PHPSESSID_WEBERP

... or some other proposal?

=====

I did find that we have session_name() used in two other areas:

/api/api_session.inc: session_name('webERPapi');

/install/index.php: session_name('weberp_installation');
Reply
04-03-2018, 11:41 AM, (This post was last modified: 04-03-2018, 11:42 AM by TurboPT.)
#9
RE: SuiteCRM Forces webERP Logout (NOT a webERP or SuiteCRM issue)
No other suggestions since Saturday, so I applied: PHPSESSIDwebERPteam, to be the session name.

Change committed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)