Jump to content

WHMCS php session data


BitaTel

Recommended Posts

Hi All,

 

I have been writing a WHMCS module for a custom product and have hit an issue regarding PHP session data.

 

Under the ClientArea function I am starting a session and storing 2 variables, $_SESSION['pid'] and $_SESSION['token']

 

I have tested output on the clientarea.php page and this session data is returned fine.

 

On the clientarea.php page I have a button which directs the user to another script within the whmcs folder that is also meant to retrieve this same session data but for some reason, doesn't. I tested by creating the session + data in a script outside of the clientarea.php which worked and session data was passed to my target script.

 

Checking the sessions on disk and the cookies it seems the session is never set however the standard WHMCS sessions work fine.

 

Is there anything specific that you need to be mindful of when handling sessions in WHMCS?

Link to comment
Share on other sites

  • 2 weeks later...

Just as an update,

 

I concluded it is impossible to retrieve WHMCS sessions outside of WHMCS pages. I instead integrated my script into a new WHMCS page and it works fine.

 

Not really the way I wanted to do it but I guess that is the "proper" way as far as WHMCS is concerned.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated