Link to home
Start Free TrialLog in
Avatar of September
September

asked on

Cookie Munger (ISAPI Filter) - I have no points but very difficult!!

I am using Personalization & Membership features of Site Server in my ecommerce sites.  The basic store setup depends on cookies to track users and and their shopping carts.  P&M has a default way of handling browsers that don't accept cookies - redirect them to a page that says "Your browser must accept cookies to use this site."  

Included in the IIS Resource Kit is an ISAPI filter called "Cookie Munger".  This filter intercepts the data on the way to the server and if there is a request for cookie info is replaces it with a sessionID at the end of the URL.  To use the filter you simply register it with the site in Internet Mgt Console - which I did.  But when I browse the site (with Cookies disabled) I still get redirected to the P&M no cookies error page.

Can Cookie Munger be used in conjunction with P&M?

Did I miss a step setting up Cookie Munger?

Are there are any resources I can refer to for Info on this ISAPI filter? I have found very little info anywhere on the web.

If noone has heard of "Cookie Munger" - do you know of any other ways around the P&M dependence on cookies?

Any help greatly appreciated - if I get more points in the meantime I will up the ante to answer this question.

September Weir
Avatar of nikhilh
nikhilh

The sites that are done with site server have to have the cookies enabled. There is a option of using cookie munger to pass the data in the cookies to be passed through the URL, but even then site server forces some cookies to be written even if you use cookie munger.

I am not too sure of why it does that. but in my experience with site server it never worked with cookies option turned off in the browser.
Avatar of September

ASKER

What did you do in the end?  Just accept the fact that browsers not accepting cookies can't use portions of the site?  Or did you rewrite parts of the site to not use cookies?  What do big sites like amazon.com do?
We have not rewritten the site. We just assume the fact that the users will have their cookies enabled on their browsers.

And we ignore that segment which does not accept cookies in their browser
Adjusted points to 100
So did you use Cookie Munger?  I would like to give it a try?  Do I have turn off the P&M no cookie error handling to make the site use the Cookie Munger?  Or do you think there are other reasons that it did not work?
There is also some exxplanation on cookie munger in the book Personalization and Membership using Site Server. This book is by Wrox press and written by Robert Howard
No I think that there are other reasons for which the cookie munger might not be working.

Also have you generated the site through the wizard?

If so there is a function which generates the shopperid if it does not find one. I think it is the function getshopperid. What are the parameters that are passed to this function

Also are you using Membership security or NT security?
Yes, we used the wizards to create the sites (then modified them).  We are using Membership authentication (security?).  And there is a method(not a function) called GetShopperID and it has no parameters.  Anything else you want to know?
I may not be too correct about the syntax, but in the global.asa file there is a SSFunction.Initmanager or something like this.

Change the parameter there from "cookieurl" to just "url"
I think I have implemented it - it is not quite working right.  

I can look around my site - put stuff in my shopping basket, take stuff out etc.  but when I go to 'purchase' it says my basket is empty.  I can see the sessionID attached to the end of the URL but the site doesn't seem to be picking that up.

I tried changing the paramter to "url" (you had the syntax right) and it couldn't track anything (ie I would add something to the basket and it would take me right to an 'empty basket' page).

Right now I have my cookies turned off and the cookie munger set to 'filter all'.  I feel like I am close (the id is appended to the url), but it is not clicking together.

Thanks so much for help so far ; )

September
Could you check that when you go from one page to another does the Shopperid remain the same?

Also could you just paste a sample url argument string?
OK, I am new to the world of ISAPI filters, so I might be messing something else up.

After my last post - I removed and "reinstalled" the CkyMunge DLL.  And I have been able to get it do anything since then.  I think it was actually working before and it was a page error causing my last problem.

So you can have the points, but I need some help setting up CkyMunge AGAIN! Just a couple of questions...

Do I have to stop the entire IIS service to add the CkyMunge filter - or just the web service for that one site?

Does the CkyMunge.dll have to be stored in any particular folder (like the InetSrv folder) or can they be placed anywhere?

Sometimes when I add the CkyMunge DLL to the list of filters (only stopping the site's web service - not IIS) it doesn't load (click OK - reopen properties and it can't seem to find it).  Other times it loads no problem - I can't seem to find a pattern, other than placing the DLL in the InetSrv directory seems to more troublesome than elsewhere.

Is it advisable to run CkyMunge filter in it's own namespace for a live site (I haven't tried this yet - but it seems like a good plan).

I a realize most of these questions are general ISAPI filter questions, and I am trying very hard to understand the interaction between the asp page and the filter - if you have any general tips??

Please try your best to answer some of my questions and you can have my points!

Thanks very much
September
OK, I am new to the world of ISAPI filters, so I might be messing something else up.

After my last post - I removed and "reinstalled" the CkyMunge DLL.  And I have been able to get it do anything since then.  I think it was actually working before and it was a page error causing my last problem.

So you can have the points, but I need some help setting up CkyMunge AGAIN! Just a couple of questions...

Do I have to stop the entire IIS service to add the CkyMunge filter - or just the web service for that one site?

Does the CkyMunge.dll have to be stored in any particular folder (like the InetSrv folder) or can they be placed anywhere?

Sometimes when I add the CkyMunge DLL to the list of filters (only stopping the site's web service - not IIS) it doesn't load (click OK - reopen properties and it can't seem to find it).  Other times it loads no problem - I can't seem to find a pattern, other than placing the DLL in the InetSrv directory seems to more troublesome than elsewhere.

Is it advisable to run CkyMunge filter in it's own namespace for a live site (I haven't tried this yet - but it seems like a good plan).

I a realize most of these questions are general ISAPI filter questions, and I am trying very hard to understand the interaction between the asp page and the filter - if you have any general tips??

Please try your best to answer some of my questions and you can have my points!

Thanks very much
September
ASKER CERTIFIED SOLUTION
Avatar of nikhilh
nikhilh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Thanks very much nikhilh (is that your name?).

How does this work - can I keep the dialogue going after I assigned the points?  

I can't work on it this morning because out test server is dow.  But I will let you know how it turns out.

Thanks again
September


To install Cookie Munger, do the following:

1. Copy Ckymunge.dll to a suitable location, such as \InetPub\Scripts or \Winnt\System32\InetSrv.

2. Use the Internet Service Manager to stop the WWW service.

3. Add Ckymunge.dll to the list of ISAPI filters in the system registry (HKEY_LOCAL_MACHINE\ System\CurrentControlSet\Services\W3Svc\Parameters\Filter DLLs). To do so, use the Internet Service Manager. In the Properties dialog for the Web site, click the ISAPI Filters tab. Add the Ckymunge.dll to the list of ISAPI filters.

Be sure to use the full path for Ckymunge.dll. This value is a comma-separated list. The filter should be added to the end of the list. When the filter is uninstalled, the string that was added should be removed with care in respect to those situations where other ISAPI filters have been added or removed since the DLL was installed.

If you have other filters installed, the order in which they are executed may become important. Cookie Munger is a medium-priority filter.

4. The first time the filter is used, it will create the \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ckymunge\MungeMode registry value. Set the Cookie Munger operating mode in this registry setting to one of the following values:

0 = Off. No filtering occurs (the same result could be achieved by removing the Cookie Munger from the list of filters).
1 = On. Basic operation: All outgoing cookies are filtered, and URLs are munged as normal.

2 = Smart.The filter will first munge URLs but let the cookies go out to the browser. If the cookie comes back, URLs will no longer be munged, and cookies will not be eaten. If the cookie does not come back, all other outgoing cookies will be filtered and URLs will be munged.

5. Start the WWW service.