Welcome Guest, Not a member yet? Register   Sign In
Cookie refresh issue
#1

[eluser]agubski[/eluser]
Hi everyone,

I have a following challenge. I set cookie in a controller and then call view file that has a cookie check condition in it. The challenge is that the condition check fails as if the cookie is not set, but when I refresh page the cookie check is positive. Same goes for sign out procedure. It seems like change in cookie status is not detected immediately and needs few seconds.

Is there a way to bypass this?

Thanks

Alex
#2

[eluser]pistolPete[/eluser]
Do you use the CI session class?
Why do you check the cookie in the view file?

Anyway, a cookie is not available until the next request:
http://php.net/manual/en/function.setcookie.php
Quote:Once the cookies have been set, they can be accessed on the next page load with the $_COOKIE or $HTTP_COOKIE_VARS arrays.




Theme © iAndrew 2016 - Forum software by © MyBB