Welcome Guest, Not a member yet? Register   Sign In
CI session
#11

[eluser]lectrotext[/eluser]
No dice on sess_time_to_update. I also saw an improvement by setting #config['cookie_domain'] but it again didn't last beyond 1-2 days. Next is combing through the Session class.
#12

[eluser]jacobkball[/eluser]
I've had trouble with the 1.7 session class as well, in that it keeps regenerating a new session_id for every page load, when using the database. If I switch the db part off, it seems to work fine. I'm not sure whether it's got anything to do with using FreakAuth as well, which uses the db_session library. There's probably some conflict there - I'll have to try it in another application without FreakAuth.
#13

[eluser]Unknown[/eluser]
[quote author="jacobkball" date="1230883956"]I've had trouble with the 1.7 session class as well, in that it keeps regenerating a new session_id for every page load, when using the database. If I switch the db part off, it seems to work fine. I'm not sure whether it's got anything to do with using FreakAuth as well, which uses the db_session library. There's probably some conflict there - I'll have to try it in another application without FreakAuth.[/quote]

I just downloaded CI again ( for the first time in 2 years) to give it a try.

1) Before I did anything, I created my DB/Uname/Pword
2) Imported the SQL
3) Set configs for site, and also in data > $config['sess_use_database'] = TRUE;

4) $config['log_threshold'] = 4; Yet no logging happening ??or showing any errors.. IS this a permission issue??

5) And not even me, hitting the site...in it's inital state...is recording...(to the database) or throwing an error? Should it? Am I wasting my time again with this CI thing?

Is it a new bug maybe?

THX !!
#14

[eluser]jacobkball[/eluser]
trochia,

If you've set the logging to 4, and there's still nothing there, I would say that your system/logs folder permissions are not correct. Try 755 or 777 on *nix systems, or uncheck the Read Only flag in Windows.

I don't understand what you're trying to say in point 5.

As for wasting your time? I don't think so, but it depends what you want CI to do, and why you thought it was a waste of time 2 years ago. It's come a long way since then!
#15

[eluser]Colin Williams[/eluser]
Are your cookie settings correct? Every time I think CI Sessions is killing me, it's just because I improperly configured my cookie settings (wrong domain, etc)
#16

[eluser]lectrotext[/eluser]
Wow. I really do not know what is going on with the Session class. Last night I set a 30 day Session for my website. This morning I went back to the site and another session cookie was created without any of the user data. What is the point of being able to set a session and it's expiration if it is not honored by the framework?
#17

[eluser]Michael Wales[/eluser]
What are your cookie settings? Do you have sess_match_ip set to TRUE (usually a bad idea) - there are a ton of reasons CodeIgniter might think you are a new user. If we can see some code we would be able to figure out why this is happening for you.
#18

[eluser]lectrotext[/eluser]
config.php settings
Code:
$config['sess_cookie_name']        = 'contribute_session';
$config['sess_expiration']        = 7200;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = FALSE;
$config['sess_time_to_update']     = 300;

this function is fired by AJAX when someone submits their creditials

Code:
function login_check() {
    
        $user_array = array();
        
        $id = $this->input->post('login_username');
        $pass = $this->input->post('login_password');
        $remember = $this->input->post('login_remember');
        if (!empty($id) && !empty($pass)) {
            $reply = $this->User_model->is_reg($id, $pass);
            if ($reply == 1) {
                $user_array = $this->User_model->get_user($id);
            //Set Session
                if ($remember == 'on') {
                    $this->config->set_item('sess_expiration', ((60 * 60 * 24) * 30));
                    $this->config->set_item('sess_time_to_update', ((60 * 60 *24) * 30));
                }
                $this->load->library('session');
                $this->session->set_userdata($user_array);
                $data['u_first'] = $this->session->userdata('u_first');
                $this->load->view('welcome_view', $data);    
            } else {
                echo $reply;        
            }
        } else echo "0";
    }

Michael Wales Edit: Added code tags so this is somewhat readable.
#19

[eluser]Michael Wales[/eluser]
Nevermind - I didn't even get to the AJAX call. Would probably have to dig through the code a bit to see if CI is checking the sessions lifecycle elsewhere, where your AJAX call isn't setting the expiration properly.


Quote:That's only a 2 hour session.

7200 seconds / 60 seconds per minute = 120
120 minutes / 60 minutes per hour = 2
#20

[eluser]lectrotext[/eluser]
Sorry I'm not quite following.




Theme © iAndrew 2016 - Forum software by © MyBB