CodeIgniter Forums
IE Bug - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: IE Bug (/showthread.php?tid=39178)

Pages: 1 2


IE Bug - El Forum - 03-03-2011

[eluser]domainsvault[/eluser]
Alright I know I am blindly kicking a dead horse here. But All the forums, all the blogs, all the assistance, etc.. that I have found to date in the last 48 hours has given me nothing to work with.

My issue seems to be across all IE versions, no holds barred. The issue is, the cookie for the session is not getting set in IE. So even though login is validating, and proven to work on other browsers I can't use the service I am building up on IE. I've boiled it down do the cookies and they way they are handled via CI.

My tests have included everything from setting my install of IE on 4 different computers, 3 laptops to thee absolute lowest security settings possible to see if it was a potential security issue within the browser, which it was not.
I went off the reservation onto a domain I am not even using right now. Did a simple if-else setcookie script, worked on IE like a charm. Did it on my server with CI installed on it, but outside of CI as well, again worked like a charm. Brought it into CI failed miserably.
Mind you the cookie here that I am attempting to set is off the grid from CI. So theoretically it should have written and stuck. But it didn't.

I am finally coming here cause I don't know what else to try. Ive seen posts about "Session Hybrid" Ive seen posts about hacking pieces of the core, Ive seen so much stuff, that short of the hacking to pieces parts. Nothing works. I want to avoid any serious hacks as I dont have time to waste going through the application that we have currently to fix anything that broken from said hacks. So does anyone know what the issue is, how to resolve it for real? Maybe in my reading Ive mis-interpreted stuff and just attempted to do the stuff wrong. As all documentation I have seen is like just copy and paste this drop that, do this and it "Should" work nothing about maybe making a call to it from somewhere or anything else.

So with this post I know I am kicking the dead horse on a subject thats been questioned several other places, but those answers to me have yet to help serve purpose in fixing what I need fixed. That said, my question is, have you had an issue like I currently have, and what did you do to fix it? What can I do with your information that may be helpful to me fixing my problem?


IE Bug - El Forum - 03-03-2011

[eluser]InsiteFX[/eluser]
Try this Change: IE has a problem with the under_score!
Code:
// application/config/config.php

// from
$config['sess_cookie_name'] = 'ci_session';
// to
$config['sess_cookie_name'] = 'cisession';

Also it depends on your IE options for cookies!

InsiteFX


IE Bug - El Forum - 03-03-2011

[eluser]domainsvault[/eluser]
Thank you, but unfortunately that didn't solve it Sad

But that is a fix ill stick with regardless for safe measure. For me in IE its not writing cookies at all. Its going through the process, its doing everything that works in all other browsers. But that cookie just does not write. I should also mention that we are using database support on this install of CI, from my understanding thats not a stock option set by default.

I should mention in general it seems that on IE if I try to process any cookie even on a random page I made to write a non CI related cookie and did a simple if-else to display if a cookie is there or not, the cookie doesnt write. Although I bring it onto a different site all together same if-else statement same setcookie, etc.. it works there.

So I should rephrase myself it seems maybe in IE its writing a cookie in CI, but almost just as quick as it writes it, its destroying it


IE Bug - El Forum - 03-03-2011

[eluser]InsiteFX[/eluser]
Well you have to have something wrong, because I run IE and FireFox and have no problems at all.

Check your timing settings in application/config/config.php

And also you will need to specifiy:
Code:
$config['cookie_domain']    = "http://www.whatever.com";

InsiteFX


IE Bug - El Forum - 03-03-2011

[eluser]domainsvault[/eluser]
the cookie_domain is set accordingly. Now by timing do you mean the the session_expire and sess_time_to_update?
Those are set properly to. As I said the issue solely resides with IE, every other browser works fine, Chrome Safari FF on linux, mac, and windows machines. IE fails time and time again with every fix I have found on google, on stack overflow, here on these forums. Nothing seems to be working. Ive even tried the Session Hybrid concept, and that still fails. Time and time again I run through my login. And there is no cookie value anywhere. Theres a session in the DB for it, but nothing to match it with cookie wise so I automatically get the session destroyed. And brought right back to my login page.


IE Bug - El Forum - 03-03-2011

[eluser]InsiteFX[/eluser]
You can say it's IE because like I said my apps run fine with IE and cookies!

Code:
sess_0m3oueu67iltp0rt4cb60jlfj4

And there is the name of my cookie!

You have something set wrong in your configuration or your IE browsers internet settings.

1) Show your config.php cookie settings.
2) Check to make sure your file is not saved with the BOM mark.

InsiteFX


IE Bug - El Forum - 03-04-2011

[eluser]Dennis Rasmussen[/eluser]
@domainsvault, please take a look at http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor/suggestions/1371591-add-option-to-use-php-sessions?ref=title

And if you like, give it a vote or more because the CI team sorta ignores the problem.

Edit: fixed link


IE Bug - El Forum - 03-04-2011

[eluser]louisl[/eluser]
One thing to consider is the path, have you tried setting the path to "/"?
eg:-
Code:
$cookie = array(
                       'name'   => 'uid',
                       'value'  => 'xyz',
                       'expire' => (3600*3),
                       'domain' => '',
                       'path'   => '/',
                       'prefix' => '',
                   );
    
                set_cookie($cookie);
Then retrieve it with:-
Code:
$cookie_val = get_cookie('uid');

I've found seo friendly urls can cause cookies problems because php thinks it's in a different location than it actually is.

If you set a cookie at www.mysite.com/login/ the cookie path will be /login.


IE Bug - El Forum - 03-04-2011

[eluser]domainsvault[/eluser]
@All, I do appreciate the help I am trying what you guys are implying. And I know I am not very helpful sticking my site out to show you guys what the issue is, I am bound to an NDA to not show it. However The more and more I dig into this install thats giving me issues the more and more I find out just how hacked apart it is.

Originally before posting here I spent a day and a half on google reading through every potential problem and fix to go with it. I have tryed every dropin library I could find, I have tried even some of the more advanced mods/hacks all to no eval. From removing the underscore to setting a specific path, to god knows how many things Ive tried.

The Cookie settings are correct, along side the cookie paths, and so on. Everything is as it should be through and through, and as I said it works 100% in all other browsers just not IE. I originally assumed it was a CI/IE issue some incompatibility somewhere and I had based that off of some articles and posts I have read.

@InsiteFX I never doubted your site working on IE. I find it hard to believe that something like CI would not work with IE. I have originally came here to find out what plausible causes could be. Infact based on your previous statments I went out and did a fresh core install of CI on a completely different domain different server and all else and it does work in IE, so in part somewhere between what others did prior to me coming aboard the site being developed hates IE in all its glory...


------- Right now whats going on is as I said in other browsers cookie is written right off the bat to start the session. If I reload the page using print_r() to show what the values are they show but only on those browsers, even writing my own independent cookie works. However in IE, the cookie never once gets written, if it does it lasts for such a short stint that its erased before the next page load. My biggest problem here is Ive never had to debug something that wasn't broken. Well in so many words not broken. As there is no difference I have seen yet to tell the software we are making to do something else if its IE, and outside of IE it works 100%. Up to and including my own little independent cookie. So I am just purely lost at the moment, and utterly confused, and just plain frustrated. So all this said, if anyone has a not so common idea as to what the issue could be (without being sarcastic) by all means feel free to tos it out there.


IE Bug - El Forum - 03-04-2011

[eluser]InsiteFX[/eluser]
One other thing you can do is look at the set_cookie in the application and make sure they are passing a numeric value for the time out value and not a string value in qoutes!

InsiteFX