Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeigniter session issues in Internet Explorer
    text
    copied!<p>I have a CI application that uses the CI session class. Here's the process I'm having trouble with:</p> <ol> <li>Users loads page</li> <li>Ajax request to get record from DB</li> <li>Set userdata variable with that record's ID &amp; do various DB stuff</li> <li>User refreshes the page</li> <li>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)</li> <li>re-set userdata variable to new record's ID</li> </ol> <p>etc. etc.</p> <p>This works perfectly in chrome and FF. But obviously when I come to test in IE - doesn't work. </p> <p>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. </p> <p>At this point if I clear session cookies and refresh the new record is retrieved.</p> <p>I've tried changing:</p> <pre><code>$config['sess_cookie_name'] = 'ci_session'; </code></pre> <p>to</p> <pre><code>$config['sess_cookie_name'] = 'cisession'; </code></pre> <p>Like I saw in another post but no luck. Also tried using DB for session storage but still no luck.</p> <p>Here is the problem page: <a href="http://givestream.co.uk/stream" rel="nofollow">http://givestream.co.uk/stream</a></p> <p>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.</p> <p>JS function to get record:</p> <pre><code>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('&lt;label&gt;Website&lt;/label&gt;&lt;a href="'+charity.website+'" style="color:#08C;" target="_blank"&gt;'+charity.website+'&lt;/a&gt;'); 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 = '&lt;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"&gt;Tweet&lt;/a&gt;'; 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 = '&lt;iframe src="//www.facebook.com/plugins/like.php?href=http://givestream.co.uk/stream/'+charity.slug+'&amp;amp;send=false&amp;amp;layout=standard&amp;amp;width=280&amp;amp;show_faces=false&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;font&amp;amp;height=35&amp;amp;appId=119083868224729" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:280px; height:35px;" allowTransparency="true"&gt;&lt;/iframe&gt;'; jQuery('#fb_share').html(fb); // ***********************// jQuery('#char_website').html(charity.website); jQuery('#sectors').html('&lt;label&gt;Tags&lt;/label&gt;'+charity.sectors); jQuery('#permalink').val('http://givestre.am/stream/'+charity.slug); jQuery('#refresh').activity(false); get_charity_gallery(); get_charity_shouts(); }, 'json'); return; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload