After setting the value of a session variable, will it be possible to change its value before the end of the session? If possible can I have a small example?
Shwathi.
Is it possible to change session variable value?
Moderator: General Moderators
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
session variables work just like normal variables, only that they're superglobals, but you can change them just as you would with a normal variable
Code: Select all
$_SESSION['test_value'] = 'First Value';
echo $_SESSION['test_value']; // prints First Value
$_SESSION['test_value'] = 'Second Value';
echo $_SESSION['test_value']; // prints Second Value