If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Using jQuery Cookies with Multiple Users??

Started by torre2011, 11 Jul 2013 04:09:16 PM

Previous topic - Next topic

torre2011

I have been working on a dynamic report within Report Studio using a cube as a source...I have tree prompts that hide and show so as to allow for more reporting real estate...it works real nice with the aid of jQuery.

Then I received a followup requirement from the business to keep the prompt unhidden once the page was re-prompted.  This took me down the road with using jQuery cookies.  Below is the code I am using:

<head>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.corner.js"></script>
<script src="../js/jquery.cookie.js"></script>
<script src="../js/jquery.cookies.2.2.0.min.js"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css" />
</head>

<script type="text/javascript">

var j= jQuery.noConflict();

j(function(){
// hides the Filters panel as soon as the DOM is ready
j('#Filtersdiv').hide();

j("#clicky").click(function(){
j("#Filtersdiv").animate({width:'toggle'},1000);    


var sessid1 = j.cookies.get( 'sessidbu');

if(sessid1=='CLOSED')  {
j.cookies.set( 'sessidbu', 'OPEN');
} else {
j.cookies.set( 'sessidbu', 'CLOSED');

}

var sessid2 = j.cookies.get( 'sessidbu');

j('#divselector').val(sessid2);

});
   
});
</script>

<script type="text/javascript">

var j= jQuery.noConflict();

j(document).ready(function() {

var sessid2 = j.cookies.get( 'sessidbu');

j('#divselector').val(sessid2);

if(sessid2=='CLOSED')   {
  j('#Filtersdiv').hide();
} else {
  j('#Filtersdiv').show();
}
   
});

</script>



So i use these cookies to capture the state of the div, and then whether it is open or closed, it will determine what will show after the page is refreshed.

Everything looked good...was working for me...then when another user opened the same report as I was in...they got strange results..some prompts would not even open!  It must have something to do with the cookies!

So, if anyone out there has played around with this, please let me know...or if anyone has an idea as to what is happening..please let me know.

Thanks!

calson33

As long as they opened the report on their own machine, it's not a cookies issue (at least in respect to multi-user).

Try clearing out your own cache and cookies from your browser and then trying it again.

If it works on your machine still, then have the user do the same and try again. It could be that they tried the report earlier in the development cycle and they still have an old cookie that has some invalid values.