Class BrhKt

  • All Implemented Interfaces:

    
    public final class BrhKt
    
                        
    • Constructor Detail

    • Method Detail

      • cookieValue

         final static String cookieValue(BasicRequestHandler $self, String name, String default)

        Retrieves the value of the given cookie.

        Parameters:
        name - The cookie's name.
        default - The value to return if the cookie does not exist.
        Returns:

        The value of the cookie. If no cookie is provided, an empty string is returned instead.

      • newCookie

         final static NewCookie newCookie(BasicRequestHandler $self, String name, String value, Boolean httpOnly)

        Creates an entirely new cookie by utilising the given name and parameters. It is automatically decided if the cookie should be only transmitted over an encrypted request using the HTTPS protocol.

        Parameters:
        name - The cookie's name.
        value - The value of the cookie.
        httpOnly - Determines if JavaScript is prohibited from accessing the value of a cookie.
        Returns:

        The newly created cookie.

      • newExpiredCookie

         final static NewCookie newExpiredCookie(BasicRequestHandler $self, String name, Boolean httpOnly)

        Creates a new expired cookie with the given name. A cookie's expiration date is a signal to the browser that it should remove the cookie.

        Parameters:
        name - The cookie's name.
        httpOnly - Determines if JavaScript is prohibited from accessing the value of a cookie.
        Returns:

        A new expired cookie.

      • headerValue

         final static String headerValue(BasicRequestHandler $self, String name, String default)

        Returns the value for the given header.

        Parameters:
        name - The header's name.
        default - The value to return if the header isn't given
        Returns:

        The value for the given header.If no header is provided, an empty string is returned instead.