php session related help needed

Posted on 2011-05-09
Last Modified: 2012-05-11

Is it possible to modify a session variable after set?

Question by:3xtr3m3d
    LVL 6

    Accepted Solution

    Of course, just do $_SESSION['yourvar'] = 'newvalue';
    LVL 6

    Expert Comment

    Or maybe I didn't understand your question? If so, please elaborate.
    LVL 15

    Expert Comment

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

    Open in new window

    LVL 3

    Author Comment

    Hi Thanks for the quick answers and solution

    i just wanted to change session value and now it works


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now