Session_start (); // is it added?
The code you posted is not the original code, right?
Whether you have enabled the session or not$_SESSION[$key]
If the value is assigned, it will not appear.undefined index
I guess this problem is mainly because session_id is not passed after the header jump. you can check these items:
1. whether the cookie is disabled on the client. if disabled, manually pass session_id or enable session with the header. use_trans_sid2. session_start () must be prior to any header () 3. whether session_start () is enabled for the jump target ()
Running properly, stamp demo
Add session_start ();
I used more Frameworks. haha.
Many frameworks are enabled by default.
I have read the problem that the reply key is a variable.
This variable does not exist.
That is to say, the session cannot store the value? Are you sure the disk (if any) is not full?
Set $ _ SESSION [$ key] = $ id;
Read now: var_dump ($ _ SESSION [$ key]); check to see if this works;