TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
session problem with ie and chrome
  • Hello,

    Everthing works great with Firefox and Safari with my Kohana 3.2 (auth + orm) but keeps regenerating session files with IE and Chrome.

    I have searched over forums and tried suggestions but neither worked.

    Please help.


    After trying all the possibilities I found the solution.

    It was why I was setting cookie domain. After setting it like below in bootsrap.php it started to work around all browsers:

    Cookie::$domain = FALSE;


  • I set up my local domain name to: http://se.loc Site besides at http://se.loc/kohana and Cookie::$domain = '.se.loc';

    now it works.

  • Thank you very much for posting this - I've spent half of today trying to figure out why my session was generating all of these different ID's in the database and only later I was able to track this issue to the Chromium (same as Chrome in Ubuntu) browser after I tried to run my script in Firefox in which it worked right away. Your post has saved me a bunch of time after I found this issue trying to figure out why Chromium wasn't doing what I expected it to. It's good to know that I wasn't the only one who ran into this problem :)

  • You are welcome @geocrunch. I am happy to hear that it worked for you too.

  • @sineld. Is a cookie mandatory to have sessions, if I use only database sessions?

  • Yes, cookies are always required for sessions to work, unless you use ?PHPSESSID=... in every URL, which is terrible.

  • or store PHPSESSID in the session


  • Sessception? ;)

  • Thanks for the info. I search the forum a lot, but it seems my problem is not common. I don't have a domain name, only an IP address, and a port forwarding to have the web server accessible from the Internet. I cannot use a domain name in the cookie setting, which is probably why my clients can't use IE to log in to Kohana. It works well with Firefox tough. Any ideas?

  • @sicay incase you have to do this:

    Cookie::$domain = FALSE;

  • @sineld Already try it locally. It didn't work on the server. I'll give it a try again before coming back here.

  • just try:

    $ip_address = ''; Cookie::$domain = '.'.$ip_address;

  • @sineld Thank you so much for your help, however it's still not working on IE on my production server. I put Cookie::$domain = FALSE on my dev machine using a WAMP server, and I can log in with IE. I put the same thing on my production server, doesn't work. I put my IP address as you told me, and locally it works, but not on the production server! I think it could be in my configuration. But where? I'm a little bit clueless... By the way, I have to make it work with IE, since no other browser is allowed in the work environment of my client. If you have any other ideas, I'm open. Should you need anything (config file, log, etc.), just name it, I'll give it to you.

    Thanks again!

  • Check out your .htaccess and other config files or zip your app and e-mail it to me I will check it for you. [email protected]

  • it should work fine without domain, i can't seem to reproduce your problem in Google Chrome, IE9, FF and Opera (Windows 7 x64)! and a IP is not a HOST/DOMAIN, putting a IP as a HOST/DOMAIN is just stupid ;) just do localhost or redirect ur network IP in your hosts file with a specific domain like dev.dev :)

  • @sicay, try this: //Cookie::$domain = FALSE;

  • @sineld. It was already set like that. I'm sending you my application. Thanks for your help!

  • Anytime you like.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion