You are on page 1of 1

Q.1 Ans.

What is a Cookie? What are the advantages and disadvantages of Cookies? The most common meaning of "Cookie" on the Internet refers to a piece of information sent by a Web Server to a Web Browser that the Browser software is expected to save and to send back to the Server whenever the browser makes additional requests from the Server. Depending on the type of Cookie used, and the Browsers' settings, the Browser may accept or not accept the Cookie, and may save the Cookie for either a short time or a long time. Cookies might contain information such as login or registration information, online "shopping cart" information, user preferences, etc. Advantages 1. Cookies do not require any server resources since they are stored on the client. 2. Cookies are easy to implement. 3. You can configure cookies to expire when the browser session ends (session cookies) or they can exist for a specified length of time on the client computer (persistent cookies) 4. Since cookies persist on the clients computer, space does not need to be allocated on the web server to store user-specific information. 5. Cookies can save small amounts of information for very long periods of time. 6. Cookies can be used to customize a users visit to your web site.

Disadvantages 1. Users can delete a cookies. 2. Users browser can refuse cookies, so your code has to anticipate that possibility. 3. Cookies exist as plain text on the client machine and they may pose a possible security risk as anyone can open and tamper with cookies. 4. Users can choose not to accept cookies on their web browsers. 5. Cookies are unable to save large objects, arrays, or other complex data types. Cookies can only save string, data, or numeric data types. ---------------------------------------------------------------------------------------------------------------------------Q. 2 Buffering ASP Pages: In addition to sending output to the client, Response can control how & when output is send to the client. Output can be send two different ways: buffered or unbuffered. Unbuffered output is send immediately. Buffered output is not send until the script is finished, or until a special command is given to send it. Response.Buffer: Properties The Buffer property specifies whether to buffer the output or not. When the output is buffered, the server will hold back the response to the browser until all of the server scripts have been processed, or until the script calls the Flush or End method. If this property is set, it should be before the <html> tag in the .asp file. Syntax response.Buffer[=flag]

You might also like