Design the application architecture - Objective 1.4: Configure state management Flashcards Preview

Exam 70-486: Developing ASP.NET MVC 4 Web Applications > Design the application architecture - Objective 1.4: Configure state management > Flashcards

Flashcards in Design the application architecture - Objective 1.4: Configure state management Deck (27)
Loading flashcards...
1

What 6 places can you store state information in an ASP.Net MVC application?

1. Cache
2. Session
3. Cookies
4. QueryString
5. [Http]Context.Items
6. Profile

2

What is the ASP.Net Cache?

A memory pool store on the server and shared across users

3

What is the ASP.Net Session?

A store on the server that is unique for each user

4

What are cookies?

Strings that are stored locally in the browser's cache and are sent with each HTTP request to the server

5

What is the QueryString?

The part of the URL after the question mark

6

What is the HttpContext.Items?

A place to store data which is needed only for the lifetime of the request

7

What is ASP.Net profile?

User-specific information stored in a database which persists across multiple sessions

8

What is a major consideration of using ASP.Net Cache in a web farm?

Each server needs its own copy of the Cache since any individual request cannot be guaranteed to be sent to a specific server.

9

Which class must you inherit from to implement a custom session state provider in ASP.Net, for example, one that stores session in an Oracle database,?

SessionStateStoreProviderBase

10

How do you configure IIS to support a custom session state provider?

1. Open IIS Manager and navigate to the web site.
2. In Features View, double-click Session State.
3. On the Session State page, in the Session State Mode Settings area, click Custom.
4. Click Apply in the Actions pane.

11

What are cookies?

Small snippets of information stored on the client side that can persist across sessions and are individualized to a particular domain or subdomain.

12

When are cookies sent to and from a server?

They are sent to and from a server with every request and response.

13

In ASP.Net, which class is used to read incoming cookies on the server?

HttpContext.Request.Cookies

14

In ASP.Net, which class is used to write outgoing cookies on the server?

HttpContext.Response.Cookies

15

What is a query string?

Information passed as part of the URL. The query string part of the URL is any text after the question mark.

Ex:

Given this url - http://www.microsoft.com/?id=20

The query string is id=20.

16

In ASP.Net, which class is used to read the query string sent during a request?

HttpContext.Request.QueryString

17

Why should you not put personal or information that should be secure in the query string?

Query strings/URLs are not encrypted even over SSL.

18

Where is HttpContext.Items most commonly written to?

In HTTP modules, such as during the authentication phase of a request.

19

In ASP.Net, which class is used to read user profile information?

HttpContext.Profile

20

What must be configured in the web.config before ASP.Net user profiles can be used?

A membership and a profile provider

21

What is the maximum size cookies can be?

4 KB

22

What is one advantage of using cookies over HTML5 web storage for maintaining state?

With cookies, no additional code needs to be written since cookies are automatically sent/received during requests.

23

What two JavaScript objects are used to access HTML5 web storage?

sessionStorage and localStorage

24

What is the difference between HTML5 session storage and local storage?

Local storage persists after the browser closes. Session storage persists only while the window or tab is still open.

25

In ASP.Net, how do you determine the capabilities of the current user's browser?

Access the HttpRequest.Browser property which returns an HttpBrowserCapabilities object.

26

In JavaScript, how do you determine if the browser supports HTML5 web storage?

Test the window object for the presence of the localStorage or sessionStorage properties.

Ex:

if (window.localStorage)
{
window.localStorage.setItem("MyKey", "MyValue");
}

27

In JavaScript, how do you determine if HTML5 web storage has been updated?

Add an event listener for the storage event of the window object.

Ex:

window.addEventListener("storage", myEventHandler, true);