With the thinkphp frame, just go to TP discussion to see a lot of, try a bit can not.
Don't quite understand what it is to be authenticated by login.
public function _initialize(){ // 验证用户是否登陆 if (!session('?name') or !session('?dutydate')) { $this->error('未登录,跳转到登录页面',__MODULE__.'/login/index',3); } }
Read an article like this (http://www.edbiji.com/doccenter/showdoc/54/nav/702.html), the situation with me, I do not quite understand, he this article service-side code so what is the meaning of this writing?
//初始化执行 public function _initialize(){ //此处为解决Uploadify在火狐下出现http 302错误 重新设置SESSION $session_name = session_name(); if (isset($_POST[$session_name])) { session_id($_POST[$session_name]); session_start(); } //执行登陆验证检测函数 $this->powerverify(); }
Mine is this, I only Judge session (' name ') and session (' Dutydate '),
So if I'm going to accept the value of uploadify,post coming over. $_post[' test], this is my current session.
I write according to the meaning of the article, but I think it doesn't make any sense? What do you mean, I don't know what this piece means?
public function _initialize(){ $session_name = $_POST['test']; if (isset($_POST[$session_name])) { session('name',$_POST[$session_name]); session('[start]'); } // 验证用户是否登陆 if (!session('?name') or !session('?dutydate')) { $this->error('未登录,跳转到登录页面',__MODULE__.'/login/index',3); } }
There is a free God, help to see, debugging for a long time, or not, smoke is all finished ....
Reply content:
With the thinkphp frame, just go to TP discussion to see a lot of, try a bit can not.
Don't quite understand what it is to be authenticated by login.
public function _initialize(){ // 验证用户是否登陆 if (!session('?name') or !session('?dutydate')) { $this->error('未登录,跳转到登录页面',__MODULE__.'/login/index',3); } }
Read an article like this (http://www.edbiji.com/doccenter/showdoc/54/nav/702.html), the situation with me, I do not quite understand, he this article service-side code so what is the meaning of this writing?
//初始化执行 public function _initialize(){ //此处为解决Uploadify在火狐下出现http 302错误 重新设置SESSION $session_name = session_name(); if (isset($_POST[$session_name])) { session_id($_POST[$session_name]); session_start(); } //执行登陆验证检测函数 $this->powerverify(); }
Mine is this, I only Judge session (' name ') and session (' Dutydate '),
So if I'm going to accept the value of uploadify,post coming over. $_post[' test], this is my current session.
I write according to the meaning of the article, but I think it doesn't make any sense? What do you mean, I don't know what this piece means?
public function _initialize(){ $session_name = $_POST['test']; if (isset($_POST[$session_name])) { session('name',$_POST[$session_name]); session('[start]'); } // 验证用户是否登陆 if (!session('?name') or !session('?dutydate')) { $this->error('未登录,跳转到登录页面',__MODULE__.'/login/index',3); } }
There is a free God, help to see, debugging for a long time, or not, smoke is all finished ....
Firefox does have a problem with uploadify, which is because Firefox's Flash is unable to deliver the current domain's cookie, and the official document has a solution to the problem.
Similar to how your code is handled.
Pass the session_id in the URL or POST request, or use this value to generate the session if there is a value in the request, or use the value in the cookie to get the session.
Get current user session through SESSION_ID, request to receive and then use SESSION_ID to specify user session and start
Probably as follows:
//上传前$auth = session_id();//传输该值//指定sessionif(!empty($_POST['auth'])){ session_id($_POST['auth']); session_start();}else{ session_start();}