A login form is made at header of cakephp site. Form at header is visible at every page.
<?php
echo $this->Form->create('User', array('id' => 'loginform', 'type' => 'post','name'=>'btnLoginHeader','action' =>'login')); ?>
<table>
<tr>
<td><?php echo $this->Form->button('Login', array('type'=>'submit', 'class' => 'btnLogin', 'name'=>'btnLoginHeader')); ?></td>
<td><?php echo $this->Form->input('username', array('label'=>false,'name'=>'email','placeholder'=>'Username',
'required' => 'required')); ?></td>
<td><?php echo $this->Form->input('password', array('label'=>false,'name'=>'password','placeholder'=>'Password','required' => 'required')); ?></td>
</tr>
</table>
<?php echo $this->Form->end(); ?>
In cakephp, form find controller function which is mentioned in 'action' of form, and that action in controller calls the view with the same name as function. My situation is different that I don't need view. And I have set session in login function of controller. How to work with form at header ?