"Zeba" <co******@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
Actually, i retrieve the cookie name from
myUXE.Lib.Web.AppConfigCookie.COOKIE_NAME which is actually provided
to me as .dll files to include in the project. This .dll file is
available in both the projects A and B.
Project A sets its cookie name in its web.config and Project B in its
web.config. So when in Project B's page I give
HttpCookie cookie =
Request.Cookies.Get(myUXE.Lib.Web.AppConfigCookie. COOKIE_NAME);
it actually accesses the cookie with the cookie name set by Project B.
How do I get the cookie name set by Project A ?
I misunderstood the original question. I thought that the problem was
recovering the cookie itself, when your problem is actually finding out the
name of the cookie.
If I have understood what you are doing, you are calling a DLL that
retrieves the name from its .config file. You want to force the DLL that is
in your project to read the .config file from another project. This is not
going to be easy if you are not allowed to modify the source code of the
DLL. The config file is set when the AppDomain that loads the DLL is
created, and in the case of a web app this is done by aspnet_wp and you
can't change its behaviour as far as I know.
I can think of some alternatives: One is to create an AppDomain, set the
config file to the config in the other project, and load the DLL inside it,
then call the dll.
Another alternative would be to create a folder below the main folder of
projectB, create a second web.config in that folder, copy into it the
relevant portion of the web.config in projectA, and run the page that needs
the cookie name in that folder. The web.config in the subfolder should take
priority over the web.config in the main folder.
A third alternative would be to write a webservice in projectA to return
the cookie name, and call that webservice from projectB.