Cookies Stored by Servlets Can Be Accessible to CGI scripts or ASP Pages

Cookies Stored by Servlets Can Be Accessible to CGI scripts or ASP Pages

By default, cookies are accessible to every HTTP request for the current directory, and any subdirectories. On most Web servers and servlet engines, servlets are located in a special directory. For example, when using a servlet runner (which ships with the Java Servlet Development Kit), servlets must be invoked under the /servlet/ directory:

http://webserver/servlet/servletname

If you want your cookies to be accessible elsewhere, you must specify the root path of your Webserver, using the avax.servlet.Cookie.setPath( String ) method.

 // Create a cookie for everyone to shareCookie myCookie = new Cookie ("counter", "1");// Set path for cookiemyCookie.setPath( "/" );


Once you’ve set the path, any script (for example, stored in /cgi-bin/) can access the cookies stored by your servlets.

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved