Jump to content

Archived

This topic is now archived and is closed to further replies.

poolhustler86

PHP Sessions

Recommended Posts

Stupid Question Most Likely,

With php sessions, no session comes out duplicate on different computers? I'm trying to build a session based online storefront to keep the customers products they wish to buy within a database in a shopping cart table.

I wouldnt want another customer on a different computer to have the same session id. This is a stupid question.

Or would there be a way of storing a unique value per each customer who visits the site first without the customers having to login / join up?

Help would be apprecaited.

Share this post


Link to post
Share on other sites
Well you could try something like rand() with encode().  Generate their 'id' then check to see if that id is being used, if so try again.

Share this post


Link to post
Share on other sites
Would that method cater for millions of users? millions of hits / traffic by customers?

As customers could just click out of the site and it wouldnt delete the record from mysql.

Would i be able to get away maybe with the use of rand() with a date/time function stating the time they visited the site and after a day / week delete the rows relating to previous dates.

Would that allow me to use rand() on a constant basis??

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.