We will be undergoing scheduled maintenance on May 20th, 2013 at 02:00 GMT.
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
When it comes to working with Session State Management in ASP.NET 4, one of the things we have to concern ourselves with is wait a minute, once a user hits my web server in ASP.NET 4, assigns them a SessionID, how do we then make sure that we identify this client on return trips, because storing Session data is a great idea but exactly how do we consistently move this session key if you will or this SessionID back and forth between the web server and the client, so that the clients always providing the web server with a SessionID so we can track this person. Well in the Microsoft scheme there are 3 options, now there's really 4 but the first one is Cookies and then there's using the URL and then something called Auto Detect. Now the fourth one that you don't see here is Device Detect and that is where ASP.NET's looking at the Headers coming in and it detects the type of browser and it determines which one of these it can use. That one will work but it can be problematic because browsers can, can change, there's constantly new updates of Firefox and Safari and this and that and IE. So some things can change there okay, but that's, that's called Device Detect. But let's take a look at these three options right here, because these are the ones that you really want to hone in on as you're preparing for this exam. First of all, Cookies. Now Cookies are the Default option for ASP.NET. Oddly enough this is where it will always start, if you don't change anything in the Web Config file and it will take that SessionID and attempt to write a Cookie into the users browser and all future requests to that particular web domain will include that SessionID as a cookie. That Session identifier is created on that Session Start Event out there and you can see this thing in Tracing. If you turn Tracing on, look at the bottom of the page, you can see the SessionID that's generated. Now what could possibly go wrong? Well it's Cookies, end-users can turn Cookies off, they can disable them in their browsers and it is a standard security practice for a lot of antivirus things and a lot of security type aspects and appliances out there to disable Cookies. Also most users know how to disable Cookies and they're terrified of them and they end of disabling them. So the next one is URL. And this is called Cookie List SessionIDs or Cookie List State and this is going to be used whenever the client turns off Cookies or we don't want to work with Cookies and that Session Identifier again is created on your Session Start Event. Again you can see it in Tracing if you turn it on, but the SessionID is actually embedded in the URL Request String. And you can actually see this in the browser when you navigate to the web server, if you'll look up there at the URL that's being sent, you will see this long bizarre SessionID, hieroglyphics looking thing out there. Auto Detect is a situation where the ASP.NET runtimes determine whether or not the client has Cookies turned on. If it does, it will send Cookies, if it does not, then it will use the URL and just simply pass the SessionID back and forth through the URL. So in identifying Session clients, it's very key, I mean it's fundamental to the process that we be able to read the SessionID that our web server assigned to the client on return trips. So every time the browser makes a request to the server, we've got to pass that SessionID back up to the server so I can check it. And to do that we have these 3 choices, Cookies, pass it as part of the URL, every browser accepts URLs and then Auto Detect. Check to see if the browser that made this original request is supporting Cookies and if it does, use them, if it doesn't then we'll switch back to URL. So that's the way it's going to work, just keep this in mind as you look at questions on the exam.
| Course: | Designing and Developing ASP.NET 4 Web Apps (Exam 70-519) |
| Author: | Mark Long |
| SKU: | 34292 |
| ISBN: | 978-1-61866-029-9 |
| Release Date: | 2011-12-31 |
| Duration: | 8.5 hrs / 108 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |