setCookie

void session.setCookie ( String domain, String key, String value ) (professional and enterprise editions only)

Description

Manually set a cookie in the current session state.

Parameters

  • domain The domain to which the cookie pertains, as a string.
  • key The name of the cookie, as a string.
  • value The value of the cookie, as a string.

Return Values

Returns void.

Change Log

Version Description
4.5 Available for professional and enterprise editions.

This method should be rarely used as screen-scraper automatically manages cookies. In cases where cookies are set via JavaScript, this function might be necessary.

Examples

Manually Set Cookie

 // Sets a cookie associated with "mydomain.com", using the
 // key "user" and the value "John Smith".

 session.setCookie( "mydomain.com", "user", "John Smith" );

See Also

  • clearCookies() [session] - Clear all cookies from this scraping session
  • getCookies() [session] - Gets all the cookies currently stored by this scraping session