此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【niuniuufo】截止到2008-07-07 16:34:41的历史汇总数据(不包括此帖):
发帖的总数量:0 发帖的总分数:0
结贴的总数量:0 结贴的总分数:0
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:---------------------结分的百分比:---------------------
无满意结贴率:---------------------无满意结分率:---------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
楼主【niuniuufo】截止到2008-07-07 16:34:41的历史汇总数据(不包括此帖):
发帖的总数量:0 发帖的总分数:0
结贴的总数量:0 结贴的总分数:0
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:---------------------结分的百分比:---------------------
无满意结贴率:---------------------无满意结分率:---------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
是cakephp的
function login() {
if (!empty($this->data)) {
$this->User->recursive = -1;
$cond = array(
'email' => $this->data['User']['email'],
'password' => md5($this->data['User']['password'])
);
$data = $this->User->findAll($cond);
// login成功,保存session
if(count($data) > 0) {
$this->Session->write('current_user', $data[0]['User']);
return $this->redirect('/tasks/shop_index');
} else {
// login错误
$this->Session->setFlash(XXXXXXXXXXXX);
}
} return;
}
function logout() {
$this->Session->delete('current_user');
$this->Session->setFlash('logout');
return $this->redirect('/users/login');
}============================================================================== function beforeFilter(){
//login的check
$this->setCurrentUser();
$this->releaseCurrentTask(); }
function shop_index(){
.............
.............
}
==============================================================================
结果在点返回按钮后不会进入beforeFilter,为什么呢?应该是什么样的过程啊?
//login的check
$this->setCurrentUser();
$this->releaseCurrentTask();
} 就是在每个页面前的判断。其中$this->setCurrentUser();就是在判断session。但是好像返回后根本就不会进入beforeFilter
if (session_id()==''){
$this->flash("please login","views/login");
}
?>这样肯定就不会跑到你浏览过的页面了。会做定向到login.php
还是不行啊?