Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7836429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:08:42+00:00 2026-06-02T14:08:42+00:00

I have a CI application that uses the CI session class. Here’s the process

  • 0

I have a CI application that uses the CI session class. Here’s the process I’m having trouble with:

  1. Users loads page
  2. Ajax request to get record from DB
  3. Set userdata variable with that record’s ID & do various DB stuff
  4. User refreshes the page
  5. Ajax request to get record from DB based on the session variable of the previous record (same record can not be passed back twice in a row)
  6. re-set userdata variable to new record’s ID

etc. etc.

This works perfectly in chrome and FF. But obviously when I come to test in IE – doesn’t work.

The ajax request is executed and the first record is retreived. At this point the session variable has been set. User refreshes but the same record remains.

At this point if I clear session cookies and refresh the new record is retrieved.

I’ve tried changing:

$config['sess_cookie_name']     = 'ci_session';

to

$config['sess_cookie_name']     = 'cisession';

Like I saw in another post but no luck. Also tried using DB for session storage but still no luck.

Here is the problem page: http://givestream.co.uk/stream

Load this in chrome or FF and either refresh or hit the ‘Next’ button and you’ll see it retrieves a new charity. Try this in IE and it doesn’t work unless you clear session cookies.

JS function to get record:

function get_matches(){
    var charity;
    var user_total;
    jQuery.get("/stream/get_charity/", function(data){

        charity = data.charity;
        user_total = charity.user_totals;

        /** CHANGE URL **/

        if (history.pushState) {
            window.history.pushState("object or string", "Title", "/stream/"+charity.slug);
        }

        /*****************/

        // can user accept?
        if(charity.can_donate == 0){
            // No
            jQuery('.alert-message').show();
        } else{
            jQuery('.alert-message').hide();
        }

        // Charity Binding
        jQuery('p#char_modal_description').html(charity.description);
        jQuery('.char_more_link').attr('id', charity.id);
        jQuery('h1#char_name').html(charity.char_name);
        jQuery('h2#char_modal_header').html(charity.char_name);
        jQuery('p#char_desc').html(charity.description);
        jQuery('#website').html('<label>Website</label><a href="'+charity.website+'" style="color:#08C;" target="_blank">'+charity.website+'</a>');
        jQuery('#char_total').text('\u00A3'+charity.total);
        jQuery('#donors').html(charity.recent_donors);
        jQuery('#fans').html(charity.recent_fans);

        if (typeof user_total !== 'undefined') {
            jQuery('#total_char_month').text('\u00A3'+user_total.total_char_month);
            jQuery('#total_char_alltime').text('\u00A3'+user_total.total_char_alltime);
            var has_user_seen_stream_notice = user_total.has_user_seen_stream_notice;

            if(has_user_seen_stream_notice == false){
                jQuery('#stream_help').show();
            } 
        } else{
            jQuery('#total_char_month').text('\u00A3'+0);
            jQuery('#total_char_alltime').text('\u00A3'+0);
        }

        /** TWITTER SHARE BUTTON CHANGE URL **/

        var twitter = '<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://givestream.co.uk/stream/'+charity.slug+'" data-via="givestreamuk" data-hashtags="socialgiving">Tweet</a>';
        jQuery('#twitter_share').html(twitter);

        var jstext = '!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");';

        var script   = document.createElement("script");
        script.type  = "text/javascript";
        script.text  = jstext;
        jQuery('#twitter_share').append(script);

        // *************************************//


        /** FACEBOOK SHARE WIDGET **/

            var fb = '<iframe src="//www.facebook.com/plugins/like.php?href=http://givestream.co.uk/stream/'+charity.slug+'&amp;send=false&amp;layout=standard&amp;width=280&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=35&amp;appId=119083868224729" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:280px; height:35px;" allowTransparency="true"></iframe>';
            jQuery('#fb_share').html(fb);


        // ***********************//


        jQuery('#char_website').html(charity.website);

        jQuery('#sectors').html('<label>Tags</label>'+charity.sectors);
        jQuery('#permalink').val('http://givestre.am/stream/'+charity.slug);

        jQuery('#refresh').activity(false);

        get_charity_gallery();
        get_charity_shouts();

    }, 'json');

    return;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:08:44+00:00Added an answer on June 2, 2026 at 2:08 pm

    Fixed!

    It wasn’t a ci_session issue it would seem.

    I dug a bit deeper and added

    log_message('info', 'queried!-'.$_SERVER['HTTP_USER_AGENT']);
    

    Into the controller that does the json response to see if the ajax request was actually reaching the controller and it turned out none of the IE ajax get requests actually made it to the controller.

    Turns out that even though the IE network inspector acknowleged the get request it was actually using cached ajax responses.

    I added

    jQuery.ajaxSetup ({
        // Disable caching of AJAX responses
        cache: false
    });
    

    To the top of the js script and boom. sorted.

    Thanks to @Laurencei for the help though!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Web Application (ASP.NET C# for .NET 3.5) that uses the Session
I have an application that uses CoreData. I previously had a class named Marker
I have an asp.net application c# that uses session state to store a variable
I have a web application that uses ASP.NET with InProc session handling. Normally, everything
I have this application that uses custom methods to register and loggin users using
I have a Struts 1.3 and Hibernate 3.1 application that uses an open-session-in-view pattern
I have a largish application that runs fine and uses session variables widely We
I have a Rails application that uses ActiveRecordStore for sessions. I need a PHP
I have an application that uses RPC for interprocess communications. Turns out that synchronous
I have an application that uses rest to communicate to a server, i would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.