Reply to Re: [PHP] Session expires randomly

Your name:

Reply:


Posted by Philip Hallstrom on 09/02/05 20:11

On Fri, 2 Sep 2005, Mauricio Pellegrini wrote:

> Hi, I have this problem , When I start a Session everything seems to be
> ok but sometimes with no reason the session vanishes.
>
> I'm using PHP 4.3.4 as a Apache module.
> Apache version is 1.3 under Suse Linux 8.2
>
> All settings are default , I mean session_cache_expire is 180 min.
> I understand that this setting should make sessions last for at least 3
> hours but in my case it seems not to be true since the real duration
> varies from 20 minutes to an hour
>
> I use session_start()
> and then on any routine I verify the existence of certain session
> variables.
>
> Is the server expiring the session automatically for some reason?

Just a thought... normal file based sessions are stored in /tmp. Maybe
your server has some process that is cleaning out files in /tmp that
haven't been accessed in X amount of time..

Crazy thought, but maybe that's it...

Try some tests... start a session, load a page, and have the page reload
itself every minute (being sure to access/modify the session). Put
some code in there so as soon as the session goes away it spits out the
date/time and stops so you can see how long it lasted. Let that run for
over an hour. See what happens.

Try another one, but only reload the page every 20-30 minutes or
something...

good luck!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация