-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regarding setCookie and user agent #4
Comments
That's weird... Was the autoload config file altered to not load the CodeIgniter user agent library? |
hi, sorry.. the problem was my fault.. didn't have spark installed..the info is inserting now.. i can't seem to make it work though.. whenever i login my account.. and then close my browser.. i visit the site again and it doesn't remember me |
Is it recording data to ci_cookies now? |
yes it's inserting |
I'm going to be debugging this library shortly, every once in a while I've come across what I think might be a bug where a cookie is dropped for some unknown reason. However, if this is never working for you, it sounds like the problem might be with your application code. Can you please paste in the code you are using? |
so this is where i validate the checkbox in the login with the email address being the $net_id:
then, i placed the verifyCookie() in a core Controller which is extended by my main controller:
|
Also, when my validate() function runs to log a user in for the first time, // set cookie for 1 year
$cookie = array(
'name' => 'rmtoken_' . str_replace('.', '_', $_SERVER['SERVER_NAME']),
'value' => $cookie_id,
'expire' => 31557600,
'domain' => $domain,
'path' => preg_replace('/^(http|https):\/\/(www\.)?' . $_SERVER['SERVER_NAME'] . '/', '', preg_replace('/\/$/','', base_url())),
'secure' => isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : 0
);
$this->CI->input->set_cookie($cookie); I'm still not sure why if the cookie is set here, the validateCookie() can't see it. |
whoops. my comment above was for issue #2 where i'm discussing a problem with setting the cookie, and not being able to retrieve the user from the verifyCookie() function. |
This is how i check the remember checkbox in my model post data: // check if remember me was checked... The I check "$checked ==1" and so forth, I have no issues with this spark :) |
hi, I was trying to use this library for my Remember Me checkbox, and after doing all the steps.. the information is not being inserted into the ci_cookies table.. now after trying to debug the problem, i've traced it to the insertdata array..
$insertdata = array(
'cookie_id' => $cookie_id,
'ip_address' => $ip_address,
'user_agent' => $this->CI->agent->agent_string(),
'netid' => $netid,
'created_at' => date('Y-m-d H:i:s'),
'orig_page_requested' => $orig_page_requested,
'php_session_id' => session_id()
);
i tried printing all the stuff out and the $this->CI->agent->agent_string() is causing the code to stop (also not printing anything)
The text was updated successfully, but these errors were encountered: