使用cakephp激活SSL登录?

时间:2013-10-07 16:25:37

标签: php cakephp https

我已经用我的应用程序激活了ssl,一切进展顺利......好了,登录了。登录我的应用程序是不可能的。这是我用来处理裸体http:

的表单代码
  <div class="users form">
    <div class="form-login-box">
      <?php echo $this->Session->flash('auth'); ?>
      <?php echo $this->Form->create('User', array(
        'class' => 'form-login',
        'inputDefaults' => array(
          'label' => false
         )
      )); ?>
      <fieldset>
        <?php echo $this->Form->input('username', array(
          'class' => 'form-login-username',
          'placeholder' => __('Login')
        ));
        echo $this->Form->input('password', array(
          'class' => 'form-login-password',
          'placeholder' => __('Password')
        ));
        ?>
      </fieldset>
      <input type="submit" value="<?php echo __('Login') ?>" class="form-login-submit">
    </div>
  </div>

我的控制员:

  public function login() {
    if ($this->request->is('post')) {
      if ($this->Auth->login()) {
        return $this->redirect($this->Auth->redirectUrl());
      } else {
        $this->Session->setFlash(__('Username or password is incorrect'), 'default', array('class' => 'authMessage-error'), 'auth');
      }
    }
  }

1 个答案:

答案 0 :(得分:0)

看起来你实际上没有关闭Cake方式。试试这个。

替换

<input type="submit" value="<?php echo __('Login') ?>" class="form-login-submit">

<?php echo $this->Form->end('Submit'); ?>