Vincent Jaro

Weird behaviour of $_SESSION on custom API endpoint and custom entryPoint

Discussion created by Vincent Jaro on Sep 12, 2017
Latest reply on Sep 14, 2017 by André Lopes

I am encountering a weird behavior regarding how sugar handles sessions on custom entryPoints and session on custom api endpoints.

I have created a custom entryPoint that sets a variable on the $_SESSION and then a custom view that calls an api endpoint which in turn returns the session variable set on the entryPoint.


Now the problem is, the variable that i have set on the entryPoint is not being persisted on the API endpoint.

I tried logging the sessions on each place and found out something.


$GLOBALS["log"]->fatal($GLOBALS["_SESSION"]) on the custom entryPoint returns an instance of Sugarcrm\Sugarcrm\Session\SessionStorage, while doing the same on the custom api endpoint returns an array.


I just wanted to persist the variable that i have stored on the custom entryPoint to the custom api endpoint.

This is happening on SugarCRM Professional, Version (Build 1090)

While on previous versions it's not occuring.


Any help is appreciated.