Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET MVC
Hello,
 
I had read that MVC is stateless.
Now i found the meaning of stateless that, If the user requests the same page again, the server repeats the entire sequence, reprocessing the page from scratch. Put another way, a server has no memory of pages that it has processed—page are stateless. Therefore, if an application needs to maintain information about a page.
 
but still i am confused. Not getting idea.
If MVC is stateless then session variable is not available in MVC?
Or session variable and stateless is different?
 
Thanks,
Viprat
Posted 8-Jan-13 2:07am
VIPR@T2.8K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

MVC is stateless because HTTP is. There is nothing in HTTP that indicates when a session starts or ends.
 
[Moved From 2nd answer]
They are stateless in the sense that you can never know when the user stops using your site or that the session is lost if the browser fails to transport your state parameters. Compare with FTP or IRC. They have built in session support. Try maintaining state without cookies. It's possible but ugly (the user can just remove any query string parameter or the viewstate from the POST). It's still valid HTTP, but the session will be lost
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Http is stateless by definition.
Even if classic asp.net claims to be statefull, it is simulating state by storing some state information and sending it from client to server and back. Actually the IIS + ASP.NET processing pipeline is more complicated to declare it statefull or stateless, since there are application objects that persist between several calls. But this is highly configurable and depends on many things.
 
Session is of course there in MVC also, and that's the primary storage of volatile data to be passed between calls, that we don't want to persist.
 
Believe me, the MVC approach is the canonical one, the ASP.NET classic approach was an interesting but very unique approach.
 
If you want to get an insight in ASP.NET pipeline check this article: http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp[^]
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 BillWoodruff 173
3 PIEBALDconsult 160
4 CPallini 155
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100