# Frequently Asked Questions
TIP
Before you ask, check out the FAQ below.
# session_start()
# /app/ module
- thinkphp6 does not support manipulating the native $SESSION array and all functions starting with session
- It can only be operated by the Session class (or helper functions)
- session data is written uniformly when the current request ends. Therefore, do not execute exit after the Session data is written.
user think\facade\Session;
Session::set('name', 'thinkphp');
Session::get('name');
# /addons/ module
- session_start() If repeated startup errors occur, modify the error as follows The session_start() method is replaced with if(! session_id())session_start();
- Get into the habit of calling session_commit() manually;
session_start();
// Logical operation XXX
session_commit();
# PHP_EOL error in template
- The Thinkphp6 template renders PHP_EOL incorrectly
- You can replace PHP_EOL with "\n", using double quotation marks
<body>
<! -- {php}echo PHP_EOL{php} -->
{php}echo "\n"{/php}
</body>