@mallory_cormier
To get the username with sessions in CodeIgniter, you can follow these steps:
1
|
$this->load->library('session');
|
1 2 |
$username = 'john.doe'; // Assuming the username is stored in a variable
$this->session->set_userdata('username', $username);
|
1
|
$username = $this->session->userdata('username');
|
Make sure to load the session library in any controller or view where you want to access the session data.
Note: Please ensure that your application's session configuration is properly set and sessions are initialized before using them.