SugarClub will be undergoing scheduled maintenance and will be inaccessible beginning on Friday, 10 April 2026 (15:00 UTC | 11am EDT | 1am AEST on 11 April).
This maintenance period will end on 
Monday, 13 April 2026 (12:00 UTC | 8am EDT | 10pm AEST). 

Set session variables

Hi all!

I want to set $_SESSION variable in my script what working with rest api of Sugar on one server.

But after reload sugar page, i see that $_SESSION i cleanup without my variable. How i can do that?

Parents Reply
  • Hi Alex,

    In your rest api call, are you sure that you are making the settings after starting the session?

    I've just tried on 7.6.2.1 ENT. (I don't know your sugar version), using following code i was able to write something to session using rest api then i read/use it from sugar UI.

    session_start();
    $_SESSION['tevfik'] = 'OK';
    

    You must be missing something.  My guess is you forgot to start session.

    I hope it helps.

    Best Regards

    Tevfik Tümer

    Developer Support Engineer

Children