Welcome Guest, Not a member yet? Register   Sign In
keep_flashdata bug? [urgent help needed]
#1

[eluser]PoWah[/eluser]
I dont get whats wrong. On my local machine (windows) keep_flashdata works as expected - it keeps the data in session, but on the production server (linux) it does NOT keep the data :/
Tested with firefox on both. Can somebody explain what influences that behavior?


Code:
function bid()
{
    // ...
    $this->session->set_flashdata("cb", $confirm_data);
    redirect('auction/bid_confirm');
    // ...
}

function bid_confirm()
{
    // ...
    $confirm_data = $this->session->flashdata("cb");
    if (!$confirm_data)
    {
    redirect('');
    exit;
    }
    $this->session->keep_flashdata('cb');
    // ...
}
#2

[eluser]pistolPete[/eluser]
What are the differences between testing and production server (besides the operating system)? PHP version, DB, etc.

Which CI version are you using?
#3

[eluser]PoWah[/eluser]
CI 1.6.1
Server: PHP 5.2.5, MySQL 5.0.45
Localhost PHP 5.2.8, MySQL 5.0.51a
#4

[eluser]jedd[/eluser]
I'm assuming you've echo'd out the flashdata just before you make the keepflashdata call, yeah? Is it still there at that point?
#5

[eluser]TheFuzzy0ne[/eluser]
I'm not convinced that you are actually setting it with any meaningful data to begin with. I'd suggest you try setting it with a string instead of a variable, just to be sure. Also, you may need to confirm that cookies are actually working. If you've fiddled with the settings such as cookie prefix, it may be causing problems. The [url="https://addons.mozilla.org/en-US/firefox/addon/60"]Web Developer extension for Firefox[/url] can help you do just that.
#6

[eluser]PoWah[/eluser]
no, the data is set correctly (i've done var_dump to check). Cookies is working - if they wouldnt work - whole site would stopped functioning normally (user logins, etc..)


@jedd - i've tried not to echo anything but if i get redirect it means no flash variable is available..

Okay I replaced flashdata usage at this time, no time for research this time, but i will do that in near future, because this is very strange behavior which can affect my developed auctions site a lot.
#7

[eluser]TheFuzzy0ne[/eluser]
What is the data your using? Does it log you out? I found that backslashes seem to break cookies.
#8

[eluser]jedd[/eluser]
Quote:@jedd - i've tried not to echo anything but if i get redirect it means no flash variable is available..

I meant echo it for debugging purposes. Just before you test for it. You know - to confirm it's really there and contains what you think it should.

And I thought your test, as shown, would only switch based on whether the variable resolved to true or false, not whether it is available (you'd have to do an is_set() otherwise). Could be wrong, would need to test it.
#9

[eluser]TheFuzzy0ne[/eluser]
isset()** (Sorry, Jedd!)




Theme © iAndrew 2016 - Forum software by © MyBB