Search code examples
codeignitersession-variablesbrowser-cachebrowser-history

Why does my session info get cleared when clearing history?


I'm using CodeIgniter and I set my sessions like this example:

$this->session->set_userdata('psLoggedInUser', $UserN );

During development I want to clear chache (for example), and run 'clean'. But I want to preseve my logged-in sessions. For example, I also have gmail and linkedin on other tabs and I don't want to be logged out.

However, the moment I clear browser history making sure that log-in sessions aren't cleared, I find myself out of my development site. But I remain logged into gmail.

Why is this happening? Does it mean that gmail uses a different mechanism to keep track of logged in sessions?


Solution

    1. There is a difference between Cookie and cache, Cache clears only image files and downloaded data but not cookies, Your session will always save in cookie part

    For ex. When you want to clear browser cache from chrome with alt+ctrl+del there you can see multiple options, for cache its different option to select and for cookie its different

    1. For concept of Gmail pelease select below link:

    https://superuser.com/questions/462973/how-can-i-stop-gmail-from-keeping-me-logged-in-after-i-close-the-browser

    Hope It would be helpful.