Emhope Posted October 4, 2017 Share Posted October 4, 2017 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 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted October 4, 2017 WHMCS Developer Share Posted October 4, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
Emhope Posted October 4, 2017 Author Share Posted October 4, 2017 Thank you, I will give this a try. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.