About cookies

Apr 12 2010 11:18 AM

How to invoke cookies on pageload?

i wrote the code as

{
Httpcookies obj1=null, obj2= null;

obj1=response.cookies("username");
obj2=response.cookies("password");

if(obj1!="null" && obj2!="null")
{
   server.transfer("welcome.aspx");

}


but this gives me error named 

non-invocable cookie., i.e cookie cannot be called as method...
error is in the line--obj1=response.cookies("username");
                            --obj1=response.cookies("username");


suggest me how to invoke that cookie as iam learning asp.net....

Answers (1)