Forum Moderators: coopster

Message Too Old, No Replies

Php session or MySQL

         

zeuf

4:52 pm on Oct 9, 2010 (gmt 0)

10+ Year Member



Hi everybody,

Customer connect to your website as members but I am wondering : What is the best, to know they are connected ?

1. Php Session (something like $_SESSION['connected'] = true ;)
2. A temporary table in MySQL

I mean... If you have 100.000 customers online at the same time, it will take a lot of server memory space with PHP Sessions but with a temporary SQL table, no ... No ?

Thank you for thinking with me

Anyango

6:00 pm on Oct 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



100,000 members logged in at one time ? that i believe can only happen on a very very big site. i think Sessions are the way to go to start with.

zeuf

6:19 pm on Oct 9, 2010 (gmt 0)

10+ Year Member



Hi Anyango,

You are right : 100 000 at the same, it is huge... But it could happen, right ? That is all we hope for (somewhere, inside :))

You know... I created www.daciasanderostepway.com and daciaduster.fr (The first 4x4 low cost, reliable, soon worldwide, less than $15 000, 3 years warranty or 100 000 kms (more than 180 000 miles), more than 100 000 visitors in a few months)... I am not facebook but I have to face the Sessions memory problems... Do you have to face it too ?

enigma1

6:51 pm on Oct 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have problems with the sessions or you want to optimize then don't use the php default sessions. You could setup initially a cookie with some custom signature eg: string based on ip+date/time for security which you can decode; and then start storing things in the database with a custom session that will point to the signature only if someone attempts to submit one of the customer related forms. Less queries for your server this way.

zeuf

3:10 pm on Oct 10, 2010 (gmt 0)

10+ Year Member



Hi Enigma1 and thank you.
I think you are right : using Sql db instead of php sessions.