Jump to content

Session integration


mrachal

Recommended Posts

Hello all,

 

I hope I'm not missing something.

 

A while back (several months ago) I came across information that allowed me to check if a person was logged into their WHMCS account allowing me to personalize their experience within the main part of my website. It was utilizing the PHP session that had been created.

 

I had it working well and if the person was logged in then they were presented with a link back to their client area, and if not, then they were presented with the login form that went to the WHMCS dologin.php file.

 

Fast forward to now. I started looking into more integration that would show my clients their cart count, whether thaey were logged in or not (meaning, someone that is not a client yet and was shopping on the site but outside of the WHMCS area).

 

when it didn't work, I also discovered that my login checks were also not working and the login form is always displayed.

 

Finding this, I found that the PHP and WHMCS session id's are now different. I am currently running WHMCS v5.2.14.

 

Here is what I found when checking cookie/session data:

 

- There is a PHP session id cookie - when I echo session_id() I get this.

- There is one called WHMCS + a random string - the content of that cookie is the return of session_id() within WHMCS

 

Here are my questions:

 

Why are there now 2 variables?

How can I use the WHMCS session variable outside of the WHMCS installation so I can get my personalization back and access the cart data?

 

Could someone help me with these issues, or point out my mistakes?

 

Thank your assistance.

Edited by mrachal
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