Welcome Guest, Not a member yet? Register   Sign In
csrf_protection bug. Cant make it work

And before I also suggested removing the underscore from all cookie names, not just the csrf token cookie name.

Regular cookies (session) too

$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path']  = "/";
$config['cookie_secure'] = FALSE;

I also tried using this:
$config['cookie_prefix'] = "stalkme";
$config['cookie_domain'] = "elementfx.com";
$config['cookie_path']  = "/";
$config['cookie_secure'] = FALSE;

But still no luck

I'm not using underscores in my session variables sir, because my session variables are just one word.

Your session config... I didn't mention anything about your variables.

is this what you mean sir?
$config['sess_cookie_name'] = 'cisession';

I removed the underscore. Still no luck.

UP. hello, anyone already knows a solution for this?

Couple of things you can try.

// add this to your controller:

    $data = array(
        'csrf_hash' => $this->security->get_csrf_hash(),
        'csrf_name' => $this->security->get_csrf_token_name()

// And change the hidden form field in your view to this:

<input type="hidden" name="<?php echo $csrf_name; ?>" value="<?php echo $csrf_hash; ?>" />

Well check your IE cookie settings, IE has default cookie restrictions like not allowing session cookies.

1) IE menu click on Tools button then Internet options.
2) Click on the Privacy tab then click on the Advanced button.
3) Check the Override automatic cookie handling.
4) First-party Cookies Accept.
5) Third-party Cookies Accept.
6) Check the Always allow session cookies.


Beware of underscores in the hostname, because IE won't save cookies.

Theme © iAndrew 2016 - Forum software by © MyBB