Reputation: 51
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!
Upvotes: 1
Views: 88
Reputation: 3552
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';
Upvotes: 0
Reputation: 100195
you're assigning session value to variable, you need to do the reverse, to update session value you need to do:
$_SESSION['data_for_analog_meter'] = $data_for_analog_meter;
Upvotes: 1