1

How do I update my session variables without having to log out?

I have this session array that has to be updated:

$data_for_analog_meter = $_SESSION['data_for_analog_meter'];

Any idea is appreciated!

4

2 回答 2

1

你将会话值分配给变量,你需要做相反的事情,更新你需要做的会话值:

$_SESSION['data_for_analog_meter'] = $data_for_analog_meter;
于 2013-09-26T08:19:49.440 回答
0

First don't forget to session_start() when you update it, I assume that you started it at the top of that page, and then:

  $_SESSION['name'] = 'NEW VALUE';
于 2013-09-26T08:21:45.167 回答