BBjCookie::isSecure  

Description

In BBj 12.00 and higher, this method returns whether the BBjCookie is for secure connections.

Syntax

Return Value Method
boolean isSecure()

Parameters

None.

Return Value

Returns a boolean where 0 = BBjCookie is not only for secure connections and 1 = BBjCookie is only for secure connections.

Example

The example below shows all the relevant cookie information from within a BBjServlet.

rem 'Obtain the instance of the BBjAPI object

let myAPI!=BBjAPI()

MyServlet! = new MyServlet()

data!.setCallback(data!.ON_WEB_CONNECTION, myServlet!, "myMethod")

process_events

class public MyServlet

    method public void myMethod(BBjServletEvent p_event!)
        let chan = UNT

        request! = p_event!.getHttpRequest()
        response! = p_event!.getHttpResponse()
        response!.setContentType("text/html")
        open(chan)"JSERVLET"
        print(chan)"<html><body><h1>Hello BBj!</h1>"
        cookies! = request!.getCookies()

        for i = 0 to cookies.size()-1
            cookie! = cookies!.get(i)
            print(chan)"<ul>"+cookie!.getName()
            print(chan)"<li>Comment:"+ cookie!.getComment()
            print(chan)"<li>Domain:"+ cookie!.getDomain()
            print(chan)"<li>MaxAge:"+ str(cookie!.getMaxAge())
            print(chan)"<li>Path:"+ cookie!.getPath()
            print(chan)"<li>Secure:"+ cookie!.isSecure()
            print(chan)"<li>Value:"+ cookie!.getValue()
            print(chan)"<li>Version:"+ str(cookie!.getVersion())
            print(chan)"</ul>"
        next i

        print(chan)"</body></html>"
        close(chan)
    methodend
classend

See Also

BBjAPI

BBxServletContext

BBxServletResponse

BBxServletRequest

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.