SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 48 of 48
  1. #26
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is your browser accepting the cookie? check your cookies.


    also, on that day it stopped working, did you install any new security software on your computer?

  2. #27
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any idea?

  3. #28
    SitePoint Enthusiast webdude's Avatar
    Join Date
    Feb 2005
    Location
    Great Britain
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Same problem here, and oddly enough, same output from those last 2 scripts. Worrying thing though is this:
    Code:
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Which effectively deletes the cookie as soon as it's made. Thing is though, I'm running these scripts locally btw, that cookies work for any other sites except localhost or 127.0.0.1. It's not Zonealarm or any security software I can see, so perhaps it's the router I go through to the internet, stripping out the headers.

  4. #29
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also use zone alarm, and it is not the security settings

  5. #30
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aaron118, do you not know how to check your browsers cookies? you have ignored my question twice, i cant help you if i need to repeat myself over and over.

  6. #31
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only cookies that look to be set from localhost are for phpmyadmin

  7. #32
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when you request a page locally, do you use


    http://localhost/script.php ?

  8. #33
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I honestly missed your question before. For the script im working on I request it like http://localhost/customers/script.php

    Thanks again clamcrusher

  9. #34
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your php.ini configuration, there is a "session.cookie_domain" variable. Maybe try setting that to localhost? and "session.cookie_lifetime" set to 0 (which it SHOULD default to.. but at this point I'd like to not assume).

  10. #35
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I tried setting "session.cookie_domain" to localhost, didn't work. "session.cookie_lifetime" is already set to 0.

  11. #36
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    they have the proper values, you can see the cookie in the headers list i had him post. its a typical session cookie, just the name/value pair, and the path set to /, no expires time

    i dont think you want to set the cookie domain to localhost. a blank domain means the current domain.

    im really starting to get stumped here, and really thinking something is stripping the cookie out before it reaches the browser. im not sure why phpmyadmin successfully set a cookie though. only difference is that phpmyadmin uses an expires time. but you should not have to use an expires to be able to set a cookie, an empty expires time is part of the spec and has defined behavior.

    just out of curiosity though...

    try this

    PHP Code:
    <?php
    ini_set
    ('session.cookie_lifetime'86400);
    session_start();
    echo 
    '<pre>';
    print_r(apache_response_headers());
    echo ++
    $_SESSION['i'];
    ?>
    does it increment now when you refresh the page?

    edit- make sure you restore your php.ini to not have a cookie domain if you changed it.

  12. #37
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No still no increasement, just a new session ID

  13. #38
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want to see if the cookie is actually reaching your browser.

    download this extension for firefox(your going to love this extension btw)
    https://addons.mozilla.org/firefox/60/

    install it then in your new toolbar goto information>view response headers to view the headers of the page your currently looking at. post the results here.

  14. #39
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which file should I try to view the response headers with. Anyway I have tried it with the one you have just told me to try and I get this:
    Code:
    Date: Wed, 21 Jun 2006 19:17:12 GMT
    Server: Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b mod_autoindex_color PHP/5.1.4
    X-Powered-By: PHP/5.1.4
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Keep-Alive: timeout=5, max=100
    Connection: Keep-Alive
    Content-Type: text/html
    Transfer-Encoding: chunked
    
    200 OK

  15. #40
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah if you pointed it at the file with the code i just posted, something is stripping your cookies out.

    try disabling zone alarm or any other software that might be security related.

  16. #41
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am an idiot, it was zonealarm all along. I did try disabling it before though, I must have not disabled it properly. It only works if I shut down zone alarm security suite completely. I have tried turning off sookie control in zonealarm but it is still blocking it. I don't know how to set zone alarm to allow my cookie?

    Thanks

  17. #42
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I use 127.0.0.1 instead of localhost and if I add 127.0.0.1 as an allowed site to accept cookies it will work. But I never have a problem using other sites where cookies are allowed, so why is my script causing a problem with zone alarm?

    Thanks

  18. #43
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have no idea why zone alarm behaves like that, but im glad we figured out the problem

  19. #44
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it something wrong with my script though. Becasue as I said I have never had a problem with any other sites allowing cookies?

  20. #45
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    zone alarm probably thinks its dangerous for some reason, something to do with the fact is was sent by localhost.

    that cookie valid(and probably the most common type of cookie by far!). this is a zone alarm issue, not your script. maybe it is a bug in zone alarm, maybe it is a security feature, i dont know. maybe zone alarm could tell you why it does that.

  21. #46
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I know we looked at using cookies for session information, but I'd like to try something. Comment out all the session cookie related settings in php.ini so we're dealing with standard session handling. Then right before you do your header call, call session_write_close like so:

    PHP Code:
    session_write_close();
    header("Location: blah");
    exit; 
    I think I may know why it's not working.

  22. #47
    SitePoint Addict
    Join Date
    May 2005
    Posts
    297
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you say comment out all the session cookie related settings, do you mean the settings which have session.cookie in their name? Or to comment out every setting with "session" in it. I tried with commenting out every setting with "session" in its name and and called session_write_close(); but I still couldn't log in.

    Not sure if you read above but, its zonealarm which is causing a problem with cookies on localhost. If I turn off cookie control it works on localhost.

    Thanks

  23. #48
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Zone Alarm and session varibale

    Hi guys,
    i faced the same problem u've faced about zone alarm and session variables. i made it work without shutting down zone alarm completely. i turned off 'Cookie Control' and 'Ad Blocking' in the privacy section. it worked for me. try it, it may work for u and u dont need to shut down zone alarm.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •