?
Solved

php session related help needed

Posted on 2011-05-09
4
Medium Priority
?
176 Views
Last Modified: 2012-05-11
Hi

Is it possible to modify a session variable after set?


Thanks
0
Comment
Question by:3xtr3m3d
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
rubene earned 2000 total points
ID: 35718955
Of course, just do $_SESSION['yourvar'] = 'newvalue';
0
 
LVL 6

Expert Comment

by:rubene
ID: 35718957
Or maybe I didn't understand your question? If so, please elaborate.
0
 
LVL 15

Expert Comment

by:Jagadishwor Dulal
ID: 35718976
It's confusing do you want to change session name or session value if you want to change session value it is possible.
Like:
<?php session_start();
$abc="Welcome";
$_SESSION['value']=$abc;
echo $_SESSION['value'];//Here session value is Welcome
$newval="Now I am changing the Value";
$_SESSION['value']=$newval;
echo $_SESSION['value']; //Here session value is changed.

?>

Open in new window

0
 
LVL 3

Author Comment

by:3xtr3m3d
ID: 35718990
Hi Thanks for the quick answers and solution

i just wanted to change session value and now it works

Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question