Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: sessions

  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sessions

    sorry ive searched through google but my friends php host somewhat wont use sessions or wont send or set the cookie on the client
    the script works fine on my computer and my host and another friends host but this host wont set the session
    can i somehow enable this or something?

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The first thing to do is probably to find out exactly what support the server does offer for sessions, it may be that you just need to change a setting, either through php.ini or using a .htaccess file, but first I'd do a phpinfo() on the server and look for the section headed "session" and see what support is there.

  • #3
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe you should speak to the host an ensure they have session handling set up correctly. Also, check a basic setcookie() (eg:

    PHP Code:
    <?php
    setcookie
    ('cookiename''value'time()+300);
    var_dump($_COOKIE);
    ?>
    to see if any cookies are being set. Are you on a paid host?

  • #4
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Just making sure: "common pitfall no.1" in the manual:
    Cookies will not become visible until the next loading of a page that the cookie should be visible for. To test if a cookie was successfully set, check for the cookie on a next loading page before the cookie expires. Expire time is set via the expire parameter. A nice way to debug the existence of cookies is by simply calling print_r($_COOKIE);.
    Though reloading that page should actually do the trick.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


  •  

    Posting Permissions

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