Share this page

# web_remove_cookie

Removes the specified cookie.

## C Language

    int web_remove_cookie( const char *Cookie);

Cookie Functions

## Java Language

    int object.remove_cookie( String Cookie) ;

Cookie Functions | Java Syntax

Argument | Description
--- | ---
object | An expression evaluating to an object of type WebApi. Usually web for Java. See also Function and Constant Prefixes.
Cookie | The name of the cookie to remove. The VALUE of the name is not required, and is ignored if it is specified.

## Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

## Parameterization

The following argument(s) can be parameterized using standard parameterization: Cookie

## General Information

The web_remove_cookie function removes a cookie from the list of cookies available to a Vuser. This function specifies the name of the cookie to remove.

Note: Vusers do not use (access or modify) the cookies that are stored by your browser. Instead, each script uses the cookies that are sent to the Vuser by the server host at runtime. These cookies are maintained only while the script runs. The web-cookie functions (web_add_cookie, web_remove_cookie, and web_cleanup_cookies) only manipulate these temporary cookies.

You can refine the function's usage by specifying the path and/or domain cookie attributes from the original function call. This enables you to delete one cookie among cookies with identical names, but different path and/or domain attributes. Note that if you delete a cookie using only the Cookie name (without the path or domain), the function deletes all cookies with that name, disregarding their domain and path.

web_remove_cookie is added by the user when enhancing the script. It is not recorded.

This function is supported for all web scripts.

## C Example

In the following example, the web_remove_cookie function removes the cookie with the name "client_id" from the list of cookies available to the script.

Copy code

    web_add_cookie ("client_id=Abbey; domain=www.northanger.com");
        ...
    web_remove_cookie ("client_id");

## Java Example

In the following example, the remove_cookie function removes the cookie with the name "client_id" from the list of cookies available to the script.

Copy code

    web.add_cookie ("client_id=Abbey; domain=www.northanger.com");
        ...
    web.remove_cookie ( "<i>client_id</i>" );

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: