CodeIgniter Forums
IonAuth: how to remove not needed session cookie? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: IonAuth: how to remove not needed session cookie? (/showthread.php?tid=71330)



IonAuth: how to remove not needed session cookie? - Kel - 08-01-2018

Hello everyone,

I am trying to add IonAuth to my site. I successfully load the library into the page using autoload.php. Now, however, the session cookie is set with each call. 
Since I try not to set any cookies, this is somewhat counterproductive.

In the __construct() area of my classes I added the following code to delete the cookie if the user is not logged in at all:
PHP Code:
public function __construct() {

        
// ...

 
       // Session Cleaner
 
       if (!$this->ion_auth->logged_in()) {
 
           $this->session->sess_destroy();
 
       }



However, this is not such a nice solution, because I have to do it over and over again with every new class.

My question: Can I prevent IonAuth from setting a session cookie if the user is not logged in?

Greetings
Kel


RE: IonAuth: how to remove not needed session cookie? - qury - 08-01-2018

check this:  https://www.codeigniter.com/user_guide/libraries/sessions.html?highlight=cookie#how-do-sessions-work


RE: IonAuth: how to remove not needed session cookie? - enlivenapp - 08-01-2018

While you may find someone here that can answer your question, you might be better served to ask the developer himself...

https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues