Welcome Guest, Not a member yet? Register   Sign In
Cookies not working in IE, and not fully Functional in Google Chrome
#1

[eluser]WebDruid[/eluser]
I have tried using the cookie helper and the native php cookie functions within CI, i have had no luck!

I am using CI 1.7.2, Browsers: IE8 and Google Chrome 3.0.195.38
i have created a plain php file outside of CI with native php cookie functions and it works in both Browsers (so i don't think it is a browser prob).

With my CodeIgniter Project:
In IE8 my cookies do not get created. In Google Chrome they get created but expire at the end of the session.

i have looked through all the threads i can find on cookies, but i can't seem to find anything that would help here

this is the code i used to create the Cookie
Code:
$cookie_time = time() + (3600 * 24 * 30);
      $cookie = array(
        'name' => 'crm',
        'value' => "user=$user&hash;=$pass",
        'expire' => $cookie_time
      );
      set_cookie($cookie);


this is the code i use to retrieve the cookie
Code:
if(get_cookie('crm') != false)
  {  
    parse_str(get_cookie('crm'));
    
    $success = $this->_getUserDate($user,$hash);

    if($success)
    {
      redirect('Dash');                
    }
    else $this->enter_details();
            
  }

if anyone could tell me what I'm doing wrong, it would be appreciated, thanks
#2

[eluser]InsiteFX[/eluser]
Open application/config/config.php

Try this IE doe's not like the _ character...
Code:
$config['sess_cookie_name'] = 'cisession';

Enjoy
InsiteFX
#3

[eluser]WebDruid[/eluser]
[quote author="InsiteFX" date="1268998262"]
Code:
$config['sess_cookie_name'] = 'cisession';
[/quote]

sorry no luck there.
#4

[eluser]InsiteFX[/eluser]
You can also try this if it's IE8

Go to:

Tools

Internet Options

Under General tabs go to

Browsing History

Click Delete and when new pane opens>

Uncheck Preserve Favorites website data (first one)

Uncheck all of them if you like, it will work either way (untick cookies, internet temporary files etc..,)

This new Internet Option ( Preserve Favorites website data) has to be disabled otherwise after reboot the cookies set to keep will not keep.

Enjoy
InsiteFX
#5

[eluser]WebDruid[/eluser]
[quote author="InsiteFX" date="1269028729"]
You can also try this if it's IE8
[/quote]

dunno if you read my original post, since cookies work fine outside of code igniter, in all browsers!!

iv tried more stuff... I use a _remap function in my controller, which i can set a cookie with no problem. As soon as I set the cookie in my validate function (the correct place), the cookie doesn't set!

is there scope problem, or is my _remap function causing problems??
#6

[eluser]stommert[/eluser]
what is the toplevel domain you are working with.
If there is an underscore in it, cookies don't work in IE.
#7

[eluser]WebDruid[/eluser]
im working on a internal server, so i am not setting any domains....

but on the UPSIDE, i fixed my problem by not using the _remap function. (don't know if this is a glitch)

thanks for the help




Theme © iAndrew 2016 - Forum software by © MyBB