CodeIgniter Forums
Passing a session into jQuery - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Passing a session into jQuery (/showthread.php?tid=58398)



Passing a session into jQuery - El Forum - 06-09-2013

[eluser]zazvorniki[/eluser]
I'm working on a drop down menu that when you select one of the values it redirects the page. As soon as I redirect that page I'm losing my codeigniter sessions. Is there anyway for me to pass that session through the jQuery so that variable will be there on redirect?

Here is my jQuery

Code:
$('#chapter').change(function(){
  var chapter = $(this).val();
  $(location).attr('href','http://www.writeyourfiction.com/story/readStory/'+chapter);
  });

I was reading that codeignter sessions where actually more of a cookie, so I was thinking of passing it as a cookie, but I'm still not sure just how to go about that.