tags:

views:

83

answers:

2

Hi, 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?

+1  A: 

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>
o.k.w
I found the problem. Your comment prompted me to implement a few more isset statements to confirm the status of the session. I found that the variable used to maintain sessions was not being stored correctly, therefore making the session more or less useless.Thanks for the course correction! I also implemented the Javascript just in case.
Structure
Haha, ok. I don't think I meant my answer that way. Glad it helped. :)
o.k.w
A: 

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

header("Refresh: 300");
Tor Valamo