Email lists > > [Pro. PHP Dev.] Re: Sessions > [Pro. PHP Dev.] Re: Sessions

[Pro. PHP Dev.] Re: Sessions




This post if a part of  this thread

2008-01-22 01:34:45
Re: Sessions

Hello
 ;      Better don't store sessions in database. You can use cookies and save user information in it. When you want to update any record of this user than just check if cookies active.

  Sorry if you don't like it.

    Thanks




On Jan 21, 2008 6:32 PM, Pankaj < panahujagmail.com">panahujagmail.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




--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

about | contact  Other archives ( Real Estate discussion Medical topics )