I want to access PHP session variables through jQuery. What is the best way to do this?
<?php echo json_encode($_SESSION); ?>
Be careful what you keep in the session.;)
https://github.com/zhangjiayin/php_session_json_handler/
PHP EXTENSION FOR SESSION WITH JSON SAERIALIZE FORMAT
config php.ini
session.serialize_handler = json
can help you try?