Jump to content

Properly Set Client Session


Recommended Posts

Hey Guys,

I am attempting to create a client session and in the past I've always used:

$_SESSION['uid'] = 1;

This typically works fine if I wanted to grab some information specifically for a client, but that does not seem to work within some navbars that use:

Menu::context('client');

I was wondering if there is a way to set a client session so that the navbar hooks will believe a client is currently running this session. I guess, ultimately, I want to know is there a better way to set a client session besides just setting the UID.

Thanks for any advice!

Link to comment
Share on other sites

On 5/2/2020 at 7:57 AM, SwiftModders LLC said:

Has anyone else noticed that the 


WHMCS\Authentication\Client::generateClientLoginHash()

method now requires 4 parameters as opposed to 3? Does anyone have any clue as to what the 4 parameters are?

I feel like I am probably talking to myself, but just in case anyone else is curious about the 4th paramter, it's email:

  • clientId
  • contactId
  • passwordHash
  • clientEmail

Those are the 4 parameters currently being used for the generateClientLoginHash method. Unfortunately, this didn't solve my problem with Menu::context('client'), but it could be helpful for other developers.

Ultimately, the issue I am having is I cannot figure out a way to pass Menu:context('client') as non-NULL. I would imagine that setting the UID and UPW in a session within WHMCS would generate a client object, but it doesn't. I'm not sure if there is another way around this.

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