CodeIgniter Forums

Full Version: how to turn off session
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]scieck[/eluser]
Does anybody knows a way to completely turn off cookies and sessions in CI ?

El Forum

[eluser]flaky[/eluser]
simply, don't load it

El Forum

[eluser]eoinmcg[/eluser]
by default codeigniter doesn't initiate sessions or send any cookies. so to answer your question you don't need to do anything - they are turned off.

El Forum

[eluser]scieck[/eluser]
thanks,
I inherited a project running on CI, I built a REST API on top of it, I don't have full knowledge of the code base yet. I can see from the HTTP headers that session cookies are passed in the responses and as I am not "loading it (session)" in the REST section I wrote it means the session is initiated somewhere else.
I'll look for it, thanks again.

El Forum

[eluser]eoinmcg[/eluser]
take a look in:
application/config/autload.php

if it's not there, check if the Controller class has been extended and loads it:
/application/libraries/MY_Controller.php

El Forum

[eluser]scieck[/eluser]
[quote author="eoinmcg" date="1271333614"]take a look in:
application/config/autload.php
[/quote]
Thank you, as you said, it was in fact in the
Code:
$autoload['libraries'] = {...}
array.