Further digging down to the file: ./components/com_community/controllers/register.php
This fragment is giving an error:
// Check for request forgeries
$mySess = JFactory::getSession();
if (!$mySess->has('JS_REG_TOKEN')) {
echo '<div class="error-box">' . JText::_('COM_COMMUNITY_INVALID_SESSION') . '</div>';
return;
}
Figured out that JS_REG_TOKEN is invalid or empty. Joomla version is 4.2.6, Jomsocial version 4.8.2 Website URL https:/freelit.net (you can try to register using the green button).
Changes: after install of jomsocial disabled native joomla registration as install requires. then Invite only registration was enabled under Joms (Configure-->Registration). And it did work for some time but users did not like the lengthy invite process. hence disabled invite only registration and enabled joomla native back. Now new user can not register himself.