元刷新标签会“破坏”PHP会话吗?

I am using session variables to store user display settings while their session is active.

For example, if I choose to display 5 items on the page with session variables then there is no problem. I can manually (f5) refresh the page and still see 5 items on the page. However, upon implementing the following meta tag to auto-refresh, every time the page refreshes it switches to the default value of 3.

<meta http-equiv="refresh" content="300">

I expect maybe this meta refresh is causing a new session to be created and therefore the user setting is simply out of the picture.

Does anyone have experience with this type of issue - is this the case and is there a known way to implement a page refresh and still maintain session?

From my own experience, nope, it doesn't and it shouldn't. Unless of course you refresh it after the session timeout.

Is javascript setTimeout and replace an alternative yuou are considering?

<script type="text/javascript">
  window.setTimeout('location.replace(location.href)', 300 * 1000);
</script>

You could try sending it from PHP itself using header().

header("Refresh: 300");