Jump to content

Session reset


jllunell

Recommended Posts

Hi,

 

I have a website, where a part of it it's external to whmcs and then we use WHMCS as a invoice system.

 

We do the login part in the external website, creating a session as i show below:

 

<?php print_r($_SESSION); ?> shows

 

Array ( [uid] => 31 [upw] => 490817aeb34002b2b3f8a38c738b09d9e50fd6ce ....)

 

So before upgrading to 5.2 and doing other changes it worked correctly. But after it does not. When you arrive to a WHMCS pages, it needs to log in again.

 

So if i print the session again it shows:

 

Array ( [tkval] => O8sZkQ10UAqX [calinkupdatecc] => 0 [calinkupdatesq] => 0 [loginurlredirect] => /whmcs/submitticket.php [admloginurlredirect] => /whmcs/admin/ )

 

No [uid] or [upw] are in the Session, so it does not login. Seems it reset the session and create it again.

 

Can you please tell me if there was any change in 5.2 or what can it be causing this kind of behaviour?

 

Thank you very much.

Link to comment
Share on other sites

As i've seen, it's the session_name:

 

"In the latest version of WHMCS we introduced a new session handling class which includes a random session name per install. We also updated the standard WHMCS verify image to use this new class and not call session start itself."

 

"a random session name per install", means that the session name will never change?

 

As you said on http://docs.whmcs.com/API:Validate_Login

 

"This command can be used to validate an email address and password against a registered user in WHMCS. If a match is found, it will return successful with the userid and password hash which can then be used to set the $_SESSION['uid'] and $_SESSION['upw'] values respectively in the users session to auto log the user in to WHMCS."

 

If i'm right, you should update the documentation, because you have to use the same session_name of WHMCS to make it work.

 

so:

 

session_name("xxxxxxx");

session_start();

$_SESSION['uid'] = "zzzz";

$_SESSION['upw'] = "zzzzzzz";

 

could you confirm that i'm right and it's session_name() the problem i had?

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