Creating multiple sessions can affect user performance?

0

My site creates named sessions for each page to be used in requests and stores unique generated tokens each time the page is accessed and other data.

Example:

$_SESSION['RSD']['page_username_id'] = ...

But if you do, open a new browser tab with this same page , the session is recreated with new data, so it is no longer possible to place requests on the same page as it is I would like the user to be free to access the same page in multiple tabs if you prefer!

I thought of generating a unique name for each session as soon as the page loads, but this would create many, many sessions.

So I wonder if creating multiple sessions can really affect user performance, or if you have another solution where you can have the same result of creating something that provides the unique token every time qa page is loaded and does not prevent the user from opening other tabs on the same page, thus allowing requests to be made.

    
asked by anonymous 03.09.2017 / 05:56

1 answer

1

When you create a session in PHP, it creates a cookie in the browser that is returned to you on every request. This session data is not sent to the user, it receives a code and forwards it to its server in other requests. In short: This data resides in a physical file on the Server and not on your client's browser.

I've worked a lot with php, but I had a problem when it reached large numbers of concurrent users. And when I went to see it, I had to do load balancing. And at that time the session got in a lot of trouble, so I started to study how to control sessions and I saw several ways, and I found an interesting and safe one that I use today, if you want to take a look at JWT .

But answering your question may impact on an overall level if you have many hits, and will impact everyone once because the bottleneck is on the server. With JWT, you would not have that kind of problem.

    
03.09.2017 / 14:38