Jump to content

Check if client is logged in


hostahead

Recommended Posts

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?

Link to comment
Share on other sites

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.

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