Accessing cookies from DLL

N

nathan_blakley

Hi,
I am not able to read or write cookies from DLLs both locally and on
Godaddy's web hosting site. I have ASP.NET 2 set up in both locations.
There must be a trick. My code looks as follows:

return (HttpContext.Current.Request.Cookies[m_strCookieName] != null);

I have unchecked the "Allow Unsafe Code" box in VS.

Many thanks
Nathan
 
G

George Ter-Saakov

To reqad a cookie you use Request.Cookies...
to write a cookie you use Response.Cookies....
I see code yo try to read Cookie but do not see code to write Cookie..


George.
 
N

nathan_blakley

Thank you, George. Yes, I do use the request and response objects as
you say. I apologize for not saying so.
The dll resides in the web site's bin directory and can both read and
write to a directory (after I set permissions). Cannot read or write a
cookie though.
Hate to have to rely on IP addresses but am considering it.
Nathan

To reqad a cookie you use Request.Cookies...
to write a cookie you use Response.Cookies....
I see code yo try to read Cookie but do not see code to write Cookie..

George.


Hi,
I am not able to read or write cookies from DLLs both locally and on
Godaddy's web hosting site. I have ASP.NET 2 set up in both locations.
There must be a trick. My code looks as follows:
return (HttpContext.Current.Request.Cookies[m_strCookieName] != null);
I have unchecked the "Allow Unsafe Code" box in VS.
Many thanks
Nathan
 
N

nathan_blakley

I should have mentioned, this dll contains a CompositeControl.
Nathan

Thank you, George. Yes, I do use the request and response objects as
you say. I apologize for not saying so.
The dll resides in the web site's bin directory and can both read and
write to a directory (after I set permissions). Cannot read or write a
cookie though.
Hate to have to rely on IP addresses but am considering it.
Nathan

To reqad a cookie you use Request.Cookies...
to write a cookie you use Response.Cookies....
I see code yo try to read Cookie but do not see code to write Cookie..

news:5765d743-e541-44be-aa89-41d41c21ee95@c23g2000hsa.googlegroups.com...
Hi,
I am not able to read or write cookies from DLLs both locally and on
Godaddy's web hosting site. I have ASP.NET 2 set up in both locations.
There must be a trick. My code looks as follows:
return (HttpContext.Current.Request.Cookies[m_strCookieName] != null);
I have unchecked the "Allow Unsafe Code" box in VS.
Many thanks
Nathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top