Always Submitting To Login First


<h2>Login</h2>

<div class="row-fluid">

	

	<?php $form=$this->beginWidget('CActiveForm', array(

							'id'    => 'checkout_1',

							'enableAjaxValidation' => false,

							'enableClientValidation' => true,

							'clientOptions'=>array(

									'validateOnSubmit'=>false,

							),

							'htmlOptions' => array(

								'class' => 'navbar-form',

							)

					));

	?>

		<div id="incorrect-login" class="error-msg"></div>

		<?php echo $form->textField($model,'email',array('class'=>'span9 bg-light-grey','placeholder'=>'Username or email id*')); ?>

		<?php echo $form->error($model,'email'); ?>

		

		<?php echo $form->passwordField($model,'password',array('class'=>'span9 bg-light-grey','placeholder'=>'password*')); ?>

		<?php echo $form->error($model,'password'); ?>

		

		<div class="row-fluid">

			<div class="span5">

				<p><a href="#" class="grey">Forgot</a> <span class="light-grey">your password?</span></p>

			</div>

			<div class="span3 offset1">

				<?php

					echo CHtml::ajaxSubmitButton('Login', array('customer/login'), array(

						'type' => 'POST',

						'update' => '#user_login',

						'beforeSend' => 'function(){

									$("#incorrect-login").text("Processing...");

								}',

						'success'=>"function(html) {


								if(html.indexOf('login_success')!= -1)

								{    

									$('#incorrect-login').text('Successfully logged in');

									$('#checkout_container').html(html);

									showCheckout();

								}

								else

								{

									if (html.indexOf('{')==0) 

									{

										e = jQuery.parseJSON(html);

										jQuery.each(e, function(key, value) { 

											jQuery('#checkout_1 #'+key+'_em_').show().html(value.toString());

										});

									}

									$('#incorrect-login').text('Invalid username or password');

								}

								return false;

							}",

						),

							array("class" => "btn-black pull-right")

					);

					?>


			</div>


		</div>

	<?php $this->endWidget(); ?>

</div>

This is my form which is loaded in modal via ajax. Everything looks fine but the form is always to posted to login twice. This has caused the error ‘session_regenerate_id(): Session object destruction failed’

can anyone plz help me?

Thanks

[color="#006400"]/* Moved from Bug forum because that forum is for bugs in Yii, not bugs in your code … */[/color]