CodeIgniter Forums
Session: Creates new session on every page refresh - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Session: Creates new session on every page refresh (/showthread.php?tid=67611)



Session: Creates new session on every page refresh - derena - 03-15-2017

When i refresh the page, it creates new session into the folder (or even in database it creates a new row with new id. i tried using sessions with database also. nothing's changed.). What should i do?

I am using PHP 7.1.2 and IIS 7 on Windows Server 2008 R2. Also, for CodeIgniter my version is 3.1.


RE: Session: Creates new session on every page refresh - Gowtham Karna - 03-15-2017

Hi

You wrote any insert function in on page load, Then only a single row was inserted into table and a new session possible to create.


RE: Session: Creates new session on every page refresh - derena - 03-16-2017

Sorry, maybe my question was wrong. My actual problem is when a user tries to log in, setted userdata disappears.


RE: Session: Creates new session on every page refresh - arma7x - 03-16-2017

You can do simple counter. For testing, store the increment/decrement integer value in session and retrieve it back in next page reload. If the value does not change, maybe the browser reject cookies from your web app. I'm pretty sure the problems is new session being created on every page reload. Try disable session regenerate to false or using different web browser...


RE: Session: Creates new session on every page refresh - derena - 03-16-2017

First of all, thanks for your helps. I solved the problem.

As i said before; I am using PHP 7.1.2 and IIS 7 on Windows Server 2008 R2. Also, for CodeIgniter my version is 3.1.

I updated the CI with latest version and problem has solved. If someone gets same problem, it might be about PHP and CI version conflict. I realized that there are some changes in new PHP version in that subject.