Prakash S
Prakash S

Reputation: 13

How to handle session value issues

I am storing the project code and user id using the session variable in PHP Platform.

Whenever the user enters the data, the operations are performed along with the session values.

The problem I am facing is when the user enters the data and stays idle for few minutes in the first tab before saving and in the mean time he uses a new tab and changes another project.

While saving the first tab the session values changes as the values in the second tab.

How to solve this issue?

Upvotes: 0

Views: 71

Answers (2)

Esar-ul-haq Qasmi
Esar-ul-haq Qasmi

Reputation: 1084

try array to store session values that is some thing like $_SESSION["project_code"]="your code value"; $sess_arr.=$_SESSION["project_code"]...HTH

Upvotes: 1

vineet verma
vineet verma

Reputation: 175

One possible way could be keep status of edits.. if someone is editing the same form. lock the form and show him message that someone is already making changes in this data..

As soon as form is open for editing purpose, make an ajax call with details of user and form token to store in DB. Form should be editable only for matching form tokens else lock the functionality.

Release the locks if form is edited or tokens no longer valid..

Upvotes: 2

Related Questions