To answer your main question, each request will run in it’s own encapsulated session. The variables set in one session will have no bearing on any other sessions.
To answer your secondary question, yes this is probably bad code design. Without seeing exactly what you’re doing, it’s likely you should have different endpoints for your ajax requests vs using one big controller with if statements to figure out which request you’re receiving. If some requests are closely related (ie: creating / updating / deleting the same object) then you could group them into one controller.
2
solved Does every user of a website share the same variable or are they unique to each (even though they’re named the same)