PHP Sessions

Posted by raulgonzalez, 09-12-2008, 10:57 AM
Hello, I downloaded a script for our company. Besides that script I have other scripts installed. Some hand made and some downloaded. I've noticed that on my "Sessions" folder/directory a new session gets written like every 15 seconds. Those sessions come from the first script that I mentiond. The other scripts don't write to it as much, just on a regular basis. What could possibly be the reason that this first script writes to much to the folder/directory? it looks something like this: user_id|i:1;m|s:2:"06";a|s:2:"09";y|s:4:"2009";c|s:1:"1";w|s:1:"1";o|s:1:"4"; Last edited by raulgonzalez; 09-12-2008 at 11:10 AM.

Posted by carolinahosting, 09-12-2008, 12:33 PM
if the script is destroying session data and re-creating it then that would do it.

Posted by larwilliams, 09-12-2008, 12:35 PM
Perhaps that script is insisting on using temporary files for sessions, instead of a cookie. The best thing is to set "session.only_use_cookies" to 1 in your php.ini. This forces the session to be stored on your visitor's browser and also works around some session issues with PHP itself.

Posted by Jatinder, 09-12-2008, 12:47 PM
You have got that wrong. "session.only_use_cookies" simply instructs PHP to ignore any session ID passed via a URL. It does not force session data to be stored in visitor's browser (this would be very insecure anyway). Data is still stored in temporary session files (the default session handler for PHP). Cookie only contains the session ID.

Posted by larwilliams, 09-12-2008, 12:51 PM
You are right. Misleading identifier This is what I found:

Posted by raulgonzalez, 09-12-2008, 12:53 PM
Yes that's what I read. <<>> Anyways, I enabled that and also added a captcha functionality to the "index.php" of that script. I noticed that it reduced those file writtings from 1 file every 15 seconds to about 1 file every 5 minutes. That's a los much better of course. Thank you all for your advices.

Was this answer helpful?

 Print this Article

Also Read

How is this possible?

Posted by iUnknown, 09-16-2008, 02:27 PMHello, When I run the following command on my server:...

Mirror dynamic website on other domain

Posted by ouray, 02-19-2010, 07:51 PMDoes anyone know of a way to mirror a website on another...

2 questions about setting up domain registry on my site!

Posted by 21inchguns, 09-13-2001, 09:32 AMHi there, I just have two questions regarding setting...

Avoiding cleartext passwords for mysql connection

Posted by DataCentric, 02-08-2011, 03:48 PMHey guys, Any bright ideas on how to better secure...

Tyan Toledo i3210w (S5211) Question

Posted by chriwong, 03-07-2008, 01:26 PMHello! Does any one try this mainboard? I want to...