SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am able to filter the CQWP Results using the query string by using the keyword (PageQueryString) (reference: ) Is there a similar way to filter the results using value from a cookie?

share|improve this question
up vote 1 down vote accepted

I think you should use the idea from this awesome Andrew Connel's article:

All you need to do actually, is to replace Request.QueryString to Request.Cookies.

share|improve this answer
Be aware though that CQWP has changed since SP2007 – Anders Rask May 3 '11 at 19:25

You'll probably be able to do this, but you can't do it in the CQWP itself. The XSL in the CQWP runs server side, and the cookie is going to live client side. You can instead use script (I'd recommend jQuery) to read the cookie and further filter what the CQWP has sent to the browser.

Alternatively, you could use client side script entirely with either the Client OM or SPServices.

share|improve this answer

You can get the information from a cookie. Here is what I did.

    private string GetCookieInfo(string cookieName)
        string cookieInformation = null;
        if (HttpContext.Current.Request.Cookies[cookieName] != null)
            cookieInformation = HttpContext.Current.Request.Cookies[cookieName].Value;
        return cookieInformation;

I use the value returned in the cookie in CAML query to get information from a SharePoint list. The list information returned includes a value for the web URL, which is used by the CQWP to know what data to display.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.