This article mainly talks about the use of session in Dedecms. Friends who are interested can come and learn about it.
When using session in dedecmsv5.7, please pay attention to how to open it! It’s different from how it’s used in the PHP source code! ! !
Open the session,must be preceded by @
@session_start();
Start the session, must be preceded by @, Otherwise, it will not be recognized in dedecms.
The difference here is that it is different from the PHP source code.The PHP source code puts this sentence at the front because the previous code is not allowed to be executed.
But in dedecms, if you put this sentence at the front of the page,Where there is verification code verification, a verification code error will appear,
So in dedcms, you can just open it wherever session storage is used.
After opening, the use will be the same as in the PHP source code
@session_start(); $_SESSION['test'] = "123";
Related tutorials:DedeCMS video tutorial
The above is the detailed content of How to open session in Dedecms V5.7. For more information, please follow other related articles on the PHP Chinese website!