aspxtreme

HttpCookie.Domain Property

System.Web Namespace   HttpCookie Class


Sets or retrieves the domain to associate the cookie with.

[ VB ]
Public Property Domain As String

[ C# ]
public string Domain {get; set;}

[ C++ ]
public: __property String* get_Domain ( );
public: __property void set_Domain ( String* );

[ JScript ]
public function get Domain ( ) : String;
public function set Domain ( String );

Property Value

The name of the domain to associate the cookie with. The default value is the current domain.

Remarks

Setting the Domain attribute limits transmission of the cookie to clients requesting a resource from that domain.

Example

The following example sets the cookie's domain.

[ VB ]
myCookie.Domain = "Microsoft.com"


[ C# ]
myCookie.Domain = "Microsoft.com";


[ JScript ] 
myCookie.Domain = "Microsoft.com"
See Also

HttpCookie Members



Books and more ...


Suggested Reading

Need a break ?



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme