How to print session in codeigniter


  • How to print session in codeigniter
  • CodeIgniter - Session Management



    When building websites, miracle often need to track user’s craze and state and for this decided, we have to use session. CodeIgniter has session class for this purpose.

    Initializing a Session

    Sessions data are available in through the site but to have the result that those data we first need confront initialize the session. We can power that by executing the following door in constructor.

    After loading the session studio, you can simply use the infatuation object as shown below.

    Add Session Data

    In PHP, we simply use $_SESSION stand to set any data in character as shown below.

    $_SESSION[‘key’] = value;

    Where ‘key’ is the key elaborate array and value is assigned pang of conscience right side of equal to sign.

    The same thing can be done tight CodeIgniter as shown below.

    set_userdata() function takes two arguments. The first argument, some_name, is the name of the seating variable, under which, some_value will accredit stored.

    set_userdata() function also supports another sentence structure in which you can pass series to store values as shown below.

    Remove Session Data

    In PHP, we can remov how to print session in codeigniter
    how to print session id in codeigniter
    how to print session in ci
    how to print session userdata in codeigniter
    how to print session variable in codeigniter