Problem with $_SESSION and header("Location:...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hemingvej45@gmail.com

    Problem with $_SESSION and header("Location:...

    Session variables set before a header("Locatio n: whatever") are not
    being written.

    And yes, before the header() call, I have session_write_c lose() but the
    result is the same. This problem is with PHP 4.3.10 on my hosting
    providers' server (and obviously I wouldn't like the hassle of changing
    hosting providers), but it works OK on some other PHP 4 and PHP 5
    servers.

    Is there any workaround?

  • hemingvej45@gmail.com

    #2
    Re: Problem with $_SESSION and header("Lo cation:...


    hemingvej45@gma il.com wrote:
    Session variables set before a header("Locatio n: whatever") are not
    being written.
    >
    And yes, before the header() call, I have session_write_c lose() but the
    result is the same. This problem is with PHP 4.3.10 on my hosting
    providers' server (and obviously I wouldn't like the hassle of changing
    hosting providers), but it works OK on some other PHP 4 and PHP 5
    servers.
    >
    Is there any workaround?
    Disregard. I'm really stupid. It seems that register globals was left
    enabled on this server and the variables in the session were
    overwritten by the variables in the script. Why would anyone be so lazy
    to use register globals is beyond me....

    Comment

    Working...