affiliate_link

Tuesday, October 25, 2011

Why ASP.NET appears to be faster than Classic ASP?

 Pages with the .aspx extension use compiled ASP.NET (based on Microsoft's .NET Framework), which makes them faster and more robust than server-side scripting in ASP, which is interpreted at run-time; however, ASP.NET pages may still include some ASP scripting

Reference: http://en.wikipedia.org/wiki/Active_Server_Pages

Classic ASP Built-in Objects

ASP 2.0 provided six built-in objects: Application, ASPError, Request, Response, Server, and Session. Session, for example, represents a cookie-based session that maintains the state of variables from page to page. The Active Scripting engine's support of the Component Object Model (COM) enables ASP Websites to access functionality in compiled libraries such as DLLs.

Reference: http://en.wikipedia.org/wiki/Active_Server_Pages

Implementing Cookieless Session in ASP.NET

Cookies are basically text data which a web site may store of the user's machine. Cookies are not considered as safe medium to store data as they could be dangerous in some scenario. Also there might be the case that user has cookies turned off on his machine or the browser doesn't supports the cookies. Our application might get failed if it is depended on cookies support on client side. Most of the time session id is stored at client side in cookies. Therefore we won't be able to retrieve session's data in the case when cookies are not enable.

ASP.NET Cookieless Support


ASP.NET support cookieless execution of the application when the client doens't have cookies support. When to chose cookieless, the session id is transferred via the request url. Each and every request of the application page contains the session id embedded in its url. So the web application need not to request the session from the cookies.

To set Cookieless session in an ASP.NET application set following value in web.config file

<sessionstate cookieless="true" />

When you have cookieless session then the url may look like this

http://www.dailycoding.com/Posts/(_entv9gVODTzHuenph6KAlK07..)/test.aspx

Issue

Session IDs can be hijacked which is a security issue if above mentioned approach is used

Reference: http://www.dailycoding.com/Posts/implementing_cookieless_session_aspnet.aspx