CodeIgniter Forums
native setcookie and ajax - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: native setcookie and ajax (/showthread.php?tid=21609)



native setcookie and ajax - El Forum - 08-15-2009

[eluser]deco10[/eluser]
Hi
I know this isn't really in the scope of the forum but I need to use native cookies instead of CI cookies.

I've had some problems with CI sessions and I can't risk having it work intermittently.

Is it possible to use native php cookies and have it work with the CI Ajax library?

So I should be able to set a cookie with an ajax call then show the data of that cookie with the next full page load.


Thanks for any input!


native setcookie and ajax - El Forum - 08-15-2009

[eluser]skunkbad[/eluser]
I haven't used the CI Ajax library, but I use my own ajax and standard PHP sessions on my site. I enabled hooks in config.php, and then made a hook that starts the standard PHP session for all requests. It also names the session, sets if it is persistant or not, and if so for how long. If you've used standard PHP sessions before, and you've created a hook before, then this should be a very simple task to complete.

There are many good arguments for using CIs sessions, but why not have the option to use both? I do.