Session 在cakephp中重新加载页面后使用会话保存数据

Session 在cakephp中重新加载页面后使用会话保存数据,session,cakephp,Session,Cakephp,我的方案是,我需要将用户输入的数据保存在同一台计算机上。我需要做什么?我需要处理哪些文件 <div> <?php echo $this->Form->input('Deal.billing_cust_name', array('label' => __l('Customer Name'))); echo $this->Form->input('Deal.billing_cust

我的方案是,我需要将用户输入的数据保存在同一台计算机上。我需要做什么?我需要处理哪些文件

<div>
<?php
    echo $this->Form->input('Deal.billing_cust_name',
                            array('label' => __l('Customer Name')));
    echo $this->Form->input('Deal.billing_cust_address',
                            array('label' => __l('Customer Address')));
    echo $this->Form->input('Deal.billing_cust_city',
                            array('label' => __l('Customer City')));
    echo $this->Form->input('Deal.billing_cust_country',
                            array('label' => __l('Customer Country')));
?>
</div>
<div class="grid_11 grid_right">
<?php
    //echo $this->Form->input('Deal.billing_cust_country',
    //                        array('label' => __l('Customer Country'),
    //                              'type' => 'select',
    //                              'options' => $gateway_options['countries'],
    //                              'empty' => __l('Please Select')));
    echo $this->Form->input('Deal.billing_cust_state', 
                            array('label' => __l('Customer State')));
    echo $this->Form->input('Deal.billing_zip', 
                            array('label' => __l('Zip Code')));
    echo $this->Form->input('Deal.billing_cust_tel', 
                            array('label' => __l('Phone')));
    echo $this->Form->input('Deal.billing_cust_email', 
                            array('label' => __l('Email')));
?>
</div>


在会话中保存数据的目的是什么?重新填写表单,以便在表单无法验证时用户可以修复错误?您创建了一个表单供用户输入数据。那么,究竟为什么要在页面加载时保存数据呢?只需在表单中放置一个提交按钮,然后将表单提交给控制器。默认表单提交将重新加载您的页面。@如果Michel不在=)之前进行
$this->redirect()
),他将重新加载@Bulkin这就是我说“默认表单提交”的原因。如果您不做任何其他事情。:)有两个页面A页和B页,A页有一个表单,用户将在A页表单中输入详细信息,然后他们将单击链接而不是提交按钮导航到B页,当A页重新加载时,它将移动B页,这里B页也有相同的表单,它位于A页中,但是页面A被重新加载,所以表单变为空,这就迫使用户输入与他们在页面A中输入的相同的详细信息,这已经是令人尴尬的时刻了。