Hello everybody.

I am trying to set a cookie on user login, I call it ccmdata, with expiration of 2 hours.
But for some reason it isn't working.
I tried to do var_dump to see the return. If I use set_cookie, it is returning NULL
but if I use setcookie (native PHP function), it returns TRUE.
But no matter how long I navigate or refresh the page, the cookie isn't created...
I use developer tools on firefox to see the cookies.
The CI cookie is being created normally. Even some other cookies of the auth class are being created (like remember_me), but this one isn't.

Anyone here might know what is going on?


I know it may seem trivial, but want to post some code on how your setting it? Also cookie's do have a maximum amount of data to hold (4kb). Have you tried storing session/cookie information in the database, which is a little more secure unless you encrypting your cookie.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.