Okay, I want to stress-test a part of my web application, to see just how many users our current server could handle before things get slow and we need to upgrade. The current plan is to just write up a quick JS script, and have it hammer the server with different types of requests (this portion of the application is AJAX-based) from different accounts.
The problem lies in the “different accounts” bit. For that to work, I need the JavaScript app to say, “I’m user 1086 now!” and for Yii to just plain unquestioningly accept that as truth. Specifically, I need the server to temporarily accept user ID GET values between 1000 and 1099 as actual login credentials without a cookie or password.
Unfortunately, that’s an actual login process, which will skew the results. It also involves a password. I want to optionally swap out the cookie-based session system, so that when the server receives the user ID via GET (which will vary multiple times per second), it acts as though it has received a valid cookie, and continues processing as normal from that point.
It work, but not if that code is inside a request lige $request = file_get_content($fileWithAuthentication); I think this is obvious: file_get_content has not my sessio. It is right?
This code is proposed by facebook developers page: