Jump to content

Accessing Session


Emhope

Recommended Posts

Hello,

I was hoping someone could point me in the right direct. Im trying to access a WHMCS stored session in a custom file. I would like to modify the cart session in a custom file. 

My file is very simple I open the session and print the contents. 

session_start(); 
print_r($_SESSION);

The file seems to create a new session rather than brining in the current session managed my WHMCS. My current WHMCS Sessions contains the following. 

    Array
(
    [tkval] => PCVDhXyJPw9B
    [calinkupdatecc] => 1
    [calinkupdatesq] => 1
    [cart] => Array
        (
            [domains] => Array
                (
                    [0] => Array
                        (
                            [type] => register
                            [domain] => ebayyyy.co.uk
                            [regperiod] => 1
                        )

                )

            [user] => Array
                (
                    [country] => GB
                )

        )

    [loginurlredirect] => cart.php?a=login
)
    

How do I print out the contents of the current session from my custom file?

I hope this makes sense. 

Thanks

 

Link to comment
Share on other sites

  • WHMCS Developer

You would need to include the WHMCS init.php file in order to access the WHMCS session file.

This would be available automatically in a hook, should you be using a hook, or any module you are adding to WHMCS.

For custom files, in the WHMCS root, include the init.php file, and WHMCS will start the correct session for you.

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