We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Problem with cookies on ISS 6.0RSS

1 reply

Last post Mar 13, 2009 08:27 AM by brashquido

  • Problem with cookies on ISS 6.0

    Mar 11, 2009 03:55 PM|HaraldLangner|LINK

    Hello,
    I run into trouble, when I try to install Joomla on ISS. I have tried a lot of things but nothing work.

    First:
    I installed PHP and this work: <?php phpinfo(); ?>
    I installed MySQL and it works.

    I like to try the WCMS Jommla and copied Jooma 1.5.9 into the webserver-subdirectory. I make a virtuell website and the first page comes up - if I call it in my browser. On the second page it stoped with a cookie-error.

    in php.ini I set:
    session.save_path = "C:\Inetpub\wwwroot\temp\php_sessions\"
    And gave this directory read,write,change premission for the appropriate IIS User IUSR_<Computername> and the Group IIS_WPG

    Also for session.cookie_path = "C:\Inetpub\wwwroot\temp\php_cockies\"

    And I also do this for the directory where Joomla is housed, ie. C:\Inetpub\wwwroot\joomlaweb\html

    In "C:\Inetpub\wwwroot\joomlaweb\html" I create 2 php scripts and I can work with session.

    I test this in the same way for cookies:
    test_cookie1.php

     setcookie("HL-UserID", "10");  //until Browser closed

     setcookie("HL-UserID-1Day", "10",      time()+60*60*24); // 1 day
     setcookie("HL-UserID-Text", "dadada",  time()+30); // 30sec
     
     setcookie("HL-UserID-Ary[0]", "111",  time()+30); // 30sec
     setcookie("HL-UserID-Ary[1]", "222",  time()+30); // 30sec

    test_cookie2.php

    <?php
     echo ("HL-UserID - ");
     var_dump($_COOKIE['HL-UserID']);
     echo ("</br>");

     echo ("HL-UserID-1Day - ");
     var_dump($_COOKIE['HL-UserID-1Day']);
     echo ("</br>");

     echo ("HL-UserID-Text - ");
     var_dump($_COOKIE['HL-UserID-Text']);
     echo ("</br>");

     echo ("<p> HL-UserID-Ary - ");
     var_dump($_COOKIE['HL-UserID-Ary']);
     echo ("</br>");

    //delete
    setcookie("HL-UserID-Text", "", time()-60*60*24);
    ?>

    Html Output for cookie2.php is:

    HL-UserID - string(2) "10"
    HL-UserID-1Day - string(2) "10"
    HL-UserID-Text - string(6) "dadada"

    HL-UserID-Ary - array(2) { [0]=> string(3) "111" [1]=> string(3) "222" }

    My browser does accept cookies, too.

    So, why Joomla can not do this? I get this error

    An error has occurred.:
    Cookies do not appear to be enabled on your browser client. You will not be able to install the application with this feature disabled. Alternatively, there could also be a problem with the server's [b]session.save_path[/b]. If this is the case, please consult your hosting provider if you don't know how to check or fix this yourself.

    The question is, have I forget anything to configure with ISS, that it can not accept cookies sometimes in any way. 

    Some idea?

    thanx a lot!

     

    PHP cookies


    Harald
  • Re: Problem with cookies on ISS 6.0

    Mar 13, 2009 08:27 AM|brashquido|LINK

     Sounds like your session directory permissions are correct. Only thing I'd suggest is setting session.cookie_path back to the default  (session.cookie_path = /)until you get Joomla session working correctly.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    IIS Aid
    IIS and Open Source