Welcome Guest, Not a member yet? Register   Sign In
CSRF The action you have requested is not allowed
#1

(This post was last modified: 09-24-2016, 01:46 AM by wolfgang1983.)

I know this has been asked a bit but can not find suitable solution.

When I submit form and if there is a error and then reload page it shows


Quote:The action you have requested is not allowed.

I am not sure why I am using the form helper on my login. It only seems to be if I submit form and error and then reload page / F5 it will show up bit strange? Any ideas what else to do?

If it matters I am on local host and my url is http://localhost/qna/


PHP Code:
<div class="page-wrapper">
<
div class="container">
    <
div class="row" id="login-row">
        <
div class="col-lg-6 col-lg-offset-3">
        <?
php echo form_open_multipart('admin/login', array('id' => 'form-login''class' => 'form-horizontal'));?>        
        <div class="panel panel-default">

        <div class="panel-heading">
        <h1 class="panel-title">Login</h1>
        </div>

        <div class="panel-body">

        <?php echo validation_errors('<div class="alert alert-warning">''</div>');?>

        <div class="form-group">

        <?php 

        $data 
= array(
            
'class' => 'col-lg-2 col-md-2 col-sm-2 hidden-xs'
        
);

        echo 
form_label('Username''username'$data);

        
?>

        <div class="col-lg-10 col-md-10 col-sm-12 col-xs-12">

        <?php 

        $data 
= array(
     
       'name' => 'username',
     
       'id' => 'username',
     
       'class' => 'form-control',
     
       'value' => set_value('username'),
     
       'size' => '50',
        );

        echo 
form_input($data);

        
?>

        </div>

        </div><!-- Form Group -->

        <div class="form-group">

        <?php 

        $data 
= array(
            
'class' => 'col-lg-2 col-md-2 col-sm-2 hidden-xs'
        
);

        echo 
form_label('Password''password'$data);

        
?>

        <div class="col-lg-10 col-md-10 col-sm-12 col-xs-12">

        <?php 

        $data 
= array(
     
       'name' => 'password',
     
       'id' => 'password',
     
       'class' => 'form-control',
     
       'value' => set_value('password'),
     
       'size' => '50',
        );

        echo 
form_password($data);

        
?>

        </div>

        </div><!-- Form Group -->

        </div><!-- Panel Body -->

        <div class="panel-footer">
            <?php 

            $data 
= array(
                
'type' => 'submit',
         
       'id' => 'submit',
         
       'class' => 'btn btn-ci btn-block'
            
);

            echo 
form_button($data'Login');

            
?>
        </div>

        </div><!-- Panel -->
        <?php echo form_close();?>
        </div>
    </div>
</div>
<div class="push"></div>
</div> 


PHP Code:
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'token';
$config['csrf_cookie_name'] = 'cookie';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array(); 
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
CSRF The action you have requested is not allowed - by wolfgang1983 - 09-24-2016, 01:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB