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
Admin DNAAdmin DNA 

ip of guest user of lightning community

I try with this solution,
but It returns the ip ogf salesforce server. I want to get ip of client guest user of a ligghtning community.
Is there a solution?
Thankyou in advance
SandhyaSandhya (Salesforce Developers) 

Try below code
String ip = Auth.SessionManagement.getCurrentSession().get('SourceIp');

Best Regards,
Admin DNAAdmin DNA
Thankyou Sandhya, I also try your solution but it only works for logged user, I'm unable to retrieve ip for guest users