Jump to content

can vars in include file be cached?


BillyT

Recommended Posts

Hi there

 

I posted this on another thread but thought it deserved its own.

 

I have a php script that multiple users access that has something like

 

session_start();

include('../common.php');

echo $someVar;

 

in common.php it accesses the session vars and and sets values for other vars

 

eg

 

$num=$_SESSION['num'];

$someVar = $num+5;

 

 

Is it possible for 2 users to hit the script in quick succession and for the server to return cached values to the second user, and thereby pass this second user the values from the first users session?  So for example, let's say

 

in user 1,  $_SESSION['num']=5;

and in user 2,  $_SESSION['num']=25;

 

user 1 loads page and it displays 10.  user 2 then loads page and it should display 30 but is it possible for the server to say "i've cached common.php and I already know $someVar = 10 so I'll return that to user 2".

 

I'm guessing this can't happen but just want to make sure.

 

 

Thanks in advance

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.