Reply to Re: Sessions

Your name:

Reply:


Posted by god.lightgod on 01/21/08 15:38

On jan. 21, 14:33, Pankaj <panah...@gmail.com> wrote:
> Hi,
>
> My site works on sessions. Currently when a user logs in, I store all
> information in a database table. Whenever the user does something, I
> check the database to see if the session is active. If so, I update
> the date and time and then update the other tables. If the seesion is
> not active, I ask him to enter his password again. A cron job runs
> every 30 mins to clean up the inactive sessions.
>
> The problem with this approach is that it puts a huge load on the
> database server as for every activity I have to check one table and
> based on its value, I perform other operations. What could be a more
> effective way of handling this ? I cannot rely on the session file
> created when I start a session because if a user closes the browser
> window without logging out, I should be able to mark that session as
> closed.
>
> Thanks
> Pankaj

CREATE TABLE `session` (
id not null auto_increment primary_key,
...
phpsessid ...,
...
login datetime
);

ok... Sry... This is a very stupid sample... I don't know what you
want logging...
And now... If the user visit the site you check `session`.`login`
field.... login-current time... if negative Get her/his password...
And...
session_start();
session_cache_expire(time() + 60 * MINUTE_LIMIT);

I think... nuff sed...

[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

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