Questions tagged [codeigniter-session]
13 questions
                    
                    2
                    
            votes
                
                2 answers
            
        My session doesnot work properly
I have the problem, that the following if condition always goes into the first if condition, never into the elseif condition.
This is my code below :
if ($this->session->has_userdata('role') == 1) {
    $this->session->set_flashdata('success',…
         
    
    
        Dhiraj Shrestha
        
- 58
- 5
                    2
                    
            votes
                
                2 answers
            
        Update session in codeigniter
So I have to profile in my view but, it won't change until I logout.
Could anyone help me with this problem?. 
Below is the my Login controller
    public function login(){
    $user = $this->input->post('username',true);
    $pass =…
         
    
    
        Leny Mirtasari
        
- 29
- 8
                    1
                    
            vote
                
                1 answer
            
        Alternative to codeigniter session for getting user data
I am still a beginner at codeigniter and have been picking up bits and pieces from here and there.
I have built a website using codeigniter that is used by a few people to enter information about their team members and the progress of each…
         
    
    
        samerc
        
- 45
- 7
                    0
                    
            votes
                
                0 answers
            
        Alert messages with php codeigniter 3
I am trying to display a success message every time someone login/logout/create post/delete post etc.
At the beginning it didn't show on the screen and I changed a configuration in the session.php file that a lot of people suggested and the problem…
         
    
    
        slap
        
- 1
                    0
                    
            votes
                
                1 answer
            
        Use same codeigniter files session in second codeigniter from the first one which are having different database
I have two codeigniter projects working on www.domain.com and www.domain.com/blog. I want to use the same session generated in domain.com. Using the login of the first one. I tried having same sess_save_path for both the codeigniters but does not…
         
    
    
        Parin Nagda
        
- 1
- 2
                    0
                    
            votes
                
                1 answer
            
        Cart showing 0 Items when using Codeigniter Shopping Cart Library
I am using Codeigniter 3.1.9, and added items to my shopping cart, items are added and showing but when i put my system to hibernate mode with browser open, then after turning on my sytem, the cart shows 0 products. It should contain the item that i…
         
    
    
        user3653474
        
- 3,393
- 6
- 49
- 135
                    0
                    
            votes
                
                1 answer
            
        Code igniter session management - login page refreshes rather than populating session
I'm new to Code Igniter and trying to work through the instructions as I've inherited a site built in it which I've had to upgrade after it stopped working when moving from PHP 5.6 to 7.2. I think the session management changed a lot between…
         
    
    
        clementine
        
- 13
- 2
                    0
                    
            votes
                
                1 answer
            
        Save complete model in session - Codeigniter
I want to save complete model in session, so I can use data easily in entire application.
After successful login in application I am saving model in session and session save in database in ci_session table.
Code I tried:
$loginSuccess =…
         
    
    
        Rahul Dadhich
        
- 1,213
- 19
- 32
                    0
                    
            votes
                
                1 answer
            
        Cannot get the flashdata or userdata value to another function
I am trying to get the value of the flashdata and userdata from one function to another within the same controller. It seems that I am using redirect in the func A to func B. So when the func loads it does not read the value and becomes Null. I used…
         
    
    
        Kunal Parekh
        
- 380
- 6
- 24
                    0
                    
            votes
                
                1 answer
            
        CodeIgniter flashdata does not show the value from one Function to another after redirecting
I am trying to get the flashdata value from one function to another function within the same controller. As soon as I use redirect() it looses its value and shows empty. I tried using both flashdata and session data but nothing is working. Please…
         
    
    
        Kunal Parekh
        
- 380
- 6
- 24
                    0
                    
            votes
                
                1 answer
            
        validation errors not net to the flashdata in codeigniter
I'm trying to set validation error to the my form using flashdata in codeigniter but i cannot see the error in a view here is my code of view section. I had already read other relative questions close to my this problem but i'm not found a solution!…
         
    
    
        Sahan Pasindu Nirmal
        
- 433
- 4
- 13
- 36
                    0
                    
            votes
                
                1 answer
            
        Session Data Lost after redirecting to another controller in Codeigniter
I m using CodeIgniter framework and I was unable to maintain session data while redirecting from one controller to another 
.
here is my first controller where I set session data
//Ajax login function 
function ajax_login() {
$response =…
         
    
    
        Aly Hunzik
        
- 27
- 8
                    -1
                    
            votes
                
                0 answers
            
        Session doesn't load after external webhook request in Codeigniter 4.3
I have a problem with the session in codeigniter 4.3 I have an application, and in this application I need to login, to login I use the CPF and PASSWORD when I log in I store the CPF in the session to use it in other parts of the application so far…
         
    
    
        Anderson Santos
        
- 1
- 2