CodeIgniter Forums
iOS 6 Safari and CSRF token - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: iOS 6 Safari and CSRF token (/thread-60983.html)



iOS 6 Safari and CSRF token - El Forum - 08-19-2014

[eluser]Unknown[/eluser]
Hi,

I'm using csrf token in CI, which works fine.
But in iOS 6 Safari, the csrf token cookie is not present. All other cookies created in Code Igniter are working, only the csrf token cookie is not working.

The configuration used is:

Code:
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_token';
$config['csrf_cookie_name'] = 'base_code';
$config['csrf_expire'] = 7200;

Has anyone come across this problem? How can I make the csrf token cookie work in iOS 6 Safari?

Thanks!


iOS 6 Safari and CSRF token - El Forum - 08-20-2014

[eluser]CroNiX[/eluser]
Are you using it in an iFrame by chance? If so Safari blocks 3rd party cookies in iFrames.


iOS 6 Safari and CSRF token - El Forum - 08-20-2014

[eluser]Unknown[/eluser]
No, not in an iframe. I'm not using iframes on the website...


iOS 6 Safari and CSRF token - El Forum - 08-20-2014

[eluser]CroNiX[/eluser]
Don't have an ios device so not sure. I'd just try to examine the difference between the CI cookies that work and the csrf cookie using firebug or the browsers developer tools. Maybe remove the underscores from the token/cookie names...who knows.