hostahead Posted January 19, 2010 Share Posted January 19, 2010 Hi, is there any way to check whether a client is logged in? I have integrated the website with WHMCS and want to show a log in box on my home page. I want to know whether the user is already logged in, so I can show something else instead. I don't have a clue though, my site is not on the same website so they don't share session state nor can I have access to the WHMCS cookies. Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
rmccny Posted January 20, 2010 Share Posted January 20, 2010 Hi, is there any way to check whether a client is logged in? I have integrated the website with WHMCS and want to show a log in box on my home page. I want to know whether the user is already logged in, so I can show something else instead. I don't have a clue though, my site is not on the same website so they don't share session state nor can I have access to the WHMCS cookies. Any ideas? Why don't you have access to the cookies? Is your main site and WHMCS on separate domains? As long as they are you only need to start PHP session support and look for $_SESSION['uid'] which should be a positive integer of the clients ID. This is the easiest and most reliable way. Another really slick alternative especially with separate servers and/or domains (and one that we are using) is to setup a memcached server and configure PHP to use memcache thus making session data available across servers/domains. It involves a bit of work however, and is not for the faint of heart. 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.