Welcome Guest, Not a member yet? Register   Sign In
Simple Form Validation question!
#4

[eluser]arbme666[/eluser]
Thanks again for the quick reply.

One more question is there any way for the user to specify how long they want until the session cookie will expire?

A way of overriding the $config['sess_expiration'] so when the users login they can input say 30mins?

I have tried to destroy the session cookie and make a new one but with no luck. Maybe someone could point me to some links etc.

Code:
function _set_cookie($expire)
    {
        $CI =& get_instance();
        $CI->load->helper('cookie');

        $expire = (60 * $expire) + time();

        $cookie_name = $CI->config->item('sess_cookie_name');
        $cookie_data = get_cookie($cookie_name, TRUE);

        delete_cookie($cookie_name);

        setcookie(
                $cookie_name,
                $cookie_data,
                time() - 31500000,
                $CI->config->item('cookie_path'),
                $CI->config->item('cookie_domain'),
                0
                );

        setcookie(
                $cookie_name,
                $cookie_data, // session id
                $expire,
                $CI->config->item('cookie_path'),
                $CI->config->item('cookie_domain'),
                0
                );
    }

Thanks again!


Messages In This Thread
Simple Form Validation question! - by El Forum - 04-28-2010, 03:30 PM
Simple Form Validation question! - by El Forum - 04-28-2010, 04:05 PM
Simple Form Validation question! - by El Forum - 04-28-2010, 04:07 PM
Simple Form Validation question! - by El Forum - 04-28-2010, 04:30 PM
Simple Form Validation question! - by El Forum - 04-29-2010, 01:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB