function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

User details are retrieved from Guest user instead of authenticated user (Live Agent)

So we are working on the new live agent with sites and for this we created a vf page for the pre-chat form.


We want to automatically populate that name and email address from the details of the authenticated (customer portal user) so that the user doesn't have to enter the all  detail on the pre chat form I did something like this


    Hello {!$User.FirstName}!


The problem is that even if the user is logged in, the page is retrieving  the details of the Guest user and I don't understand why.


So even if I am logged in the customer portal as TestUser, the page returns "Hi guestuser". What is the logic behind this, how can I sure that the authenticated session is passed to any page?



Thanks in advance.





You can try this code, hope it will help you.


<apex:outputpanel id="loginUserPnl" rendered="{!NOT(ISPICKVAL($User.UserType,'Guest'))}">
              <div class="registerUser">
                  Welcome, {!$User.FirstName}

  [If you got answer from my post please mark it as solution.]