Basic usage of Session
assigning values
Assignment (current scope)
session::set (' name ', ' thinkphp ');
Assignment to the "Session::set" Scope
(' name ', ' thinkphp ', ' I ');
To determine whether there is
Determines whether (the current scope) assigns a value of
session::has (' name ');
To determine whether
the Session::has (' name ', ' see ') is assigned below the "I" scope;
Take value
Value (current scope)
session::get (' name ');
Takes
the value of the Session::get (' name ', ' it ');
Returns null if the value of name does not exist.
Delete
Delete (current scope) session
::d elete (' name ');
Delete the value under the "I" Scope session
::d elete (' name ', ' to be ');
Specify scope
Specifies the current scope session
::p refix (' I ' am ');
Take values and delete
Take value and delete session
::p ull (' name ');
Returns null if the value of name does not exist.
Empty
Clears the session (current scope)
session::clear ();
Clears the I
-scoped session::clear (' it ');
2. is a combined project
The problem I encountered here is the position of the front desk. It was written at the beginning {session::get (' variable name ')}
Because you want to change to TP5 format, see the foreground needs to use {$Request. Session.name} or {$Think. session.name} format, but I have used the PHP tag to use this will be the error, because he is the default resolution to <?php echo ...? > in the format. So I changed into this.
In the final analysis, the problem is the TP5 version of the session information how to output in the foreground, and in the output before the use of PHP preprocessing (such as some simple judgments of judgment).
I need a certain amount of time to improve myself, laziness is a very important factor, I think I can overcome these, because I can not endure such a weak self, I have to be a good enough person. Let's make a little progress, come on.