0

How to get latest value of a session without refreshing the page?

I want to set a variable with dynamic values depending upon which button is clicked.I am using the session variable for this purpose but am not getting latest values.I have to refresh the page to update the session.I am using session because I want the variable to be in global scope.

SwR
  • 612
  • 1
  • 8
  • 21

1 Answers1

2

You can use the setInterval function on document.ready event along with AJAX to fetch and update the Session periodically through PHP.

A possible solution how to use the above is well depicted in the below url .

setInterval and Ajax

Hope this helps .

Community
  • 1
  • 1
Megan Fox
  • 435
  • 2
  • 6
  • 20