-1

I am confused about sessions . I have a form that adds record. In this form first step is taking costumer information and i put the customer id in a $_SESSION["customer _id"] because when I submit customer information,related the first form,the second form appears and when i submit it too i get the value $_SESSION["customer_id"] and add it database.

My question is when the times multiple users use this system, is there a possible to confuse this session value? I mean when two user is active in this system and they are both add new record there will be two $_SESSION["costumer_id"] value . Does it make the system confusing?

Darren
  • 13,050
  • 4
  • 41
  • 79
Aysu Vural
  • 73
  • 8
  • 1
    That depends on how you are generating the customer_id, if it's the identity field of a database insert or some other mechanism designed to make sure you aren't handing out duplicate customer_id's then you are golden,each user has there own session store. – Orangepill Jul 15 '15 at 06:28

2 Answers2

1

No, There is a separate session created for each user, so don't worry about the session. please refer below link its very helpful to understand the working of session.

PHP $_SESSION for multiple users at once

Community
  • 1
  • 1
Ankur Tiwari
  • 2,762
  • 2
  • 23
  • 40
  • 1
    Welcome :) and for futher query please read the corresponding PHP manual http://php.net/manual/en/session.examples.basic.php – Ankur Tiwari Jul 15 '15 at 06:34
1

Session support in PHP consists of a way to preserve certain data across subsequent accesses.

Session will be unique for each different connected users. Two different user's session will never mixed up. The stored data in session for particular user will not appear or accessible to any other user.

Pratik Soni
  • 2,498
  • 16
  • 26