I used an image Upload plug-in: uploadify. due to a 302 error in uploading files under IE and Firefox, I uploaded the current session name session_name () to the background at the front end and re-established the session, but I have done the following: the backend can receive the parameter passed by session_name (), but when the session is re-established, it will... using an image Upload plug-in:
UploadifyBecause the error 302 is uploaded under IE and Firefox, I uploaded the current session name on the front end.
session_name()To the background, re-establish the session, but I have done the following, the background can receive
session_name()But when the session is re-established, it will fail. how can this problem be solved?
Front-end:
// This is the parameter 'formdata': {'timestamp': 'that the uploadify plug-in transfers data to the backend ':'
', 'Token ':'
','
':'
', // The above session parameter is rendered like this: 'phpsessid ':'',},
Backend:
// This is the initialization method of a public controller to verify the login function _ construct () {parent ::__ construct (); $ session_name = session_name (); $ post_session_name = $ this-> input-> post ($ session_name); if (isset ($ post_session_name) {// you can enter session_id ($ post_session_name) here after testing ); // However, in this case, you want to set session failure session_start ();} if (! $ This-> session-> valid_user () {// because the session fails to be set, the frontend returns 302 redirect (module_url ('Common/login '));}}
Reply content:
Using an image Upload plug-in:UploadifyBecause the error 302 is uploaded under IE and Firefox, I uploaded the current session name on the front end.session_name()To the background, re-establish the session, but I have done the following, the background can receivesession_name()But when the session is re-established, it will fail. how can this problem be solved?
Front-end:
// This is the parameter 'formdata': {'timestamp': 'that the uploadify plug-in transfers data to the backend ':'
', 'Token ':'
','
':'
', // The above session parameter is rendered like this: 'phpsessid ':'',},
Backend:
// This is the initialization method of a public controller to verify the login function _ construct () {parent ::__ construct (); $ session_name = session_name (); $ post_session_name = $ this-> input-> post ($ session_name); if (isset ($ post_session_name) {// you can enter session_id ($ post_session_name) here after testing ); // However, in this case, you want to set session failure session_start ();} if (! $ This-> session-> valid_user () {// because the session fails to be set, the frontend returns 302 redirect (module_url ('Common/login '));}}
Check whether there is any error message in the log?session_idIt must be set before the session starts. is the session enabled somewhere else before the controller's _ construct () call? Try adding one before session_id.session_abort()What about it?
By default, you can use the cookie to save session_id to check whether the cookie is disabled or cleared.