PHP session when called wp_ajax_nopriv

WordPress does not use or affect PHP Sessions in any way. Therefore, the session functions will work exactly the same whether you’re using WordPress or plain PHP or AJAX requests or anything else.

However, PHP Sessions depend very heavily on your specific PHP configuration. If you don’t have the PHP Session settings configured correctly in the PHP.INI, then they tend to not work properly. And a lot of web hosts don’t have properly configured defaults for sessions. Therefore, PHP sessions are not safe to use unless you have control over the configuration of the server, and are not suitable for distributed code because a lot of hosts don’t have good configurations.

So, make sure you have the setting settings set up correctly in PHP before trying to use them.

https://php.net/manual/en/session.configuration.php