Click here to Skip to main content
15,902,189 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Protecting POST from an action Pin
Quake2Player3-Oct-09 9:54
Quake2Player3-Oct-09 9:54 
GeneralRe: Protecting POST from an action Pin
Abhishek Sur3-Oct-09 10:44
professionalAbhishek Sur3-Oct-09 10:44 
GeneralRe: Protecting POST from an action Pin
Quake2Player3-Oct-09 11:06
Quake2Player3-Oct-09 11:06 
GeneralRe: Protecting POST from an action Pin
Christian Graus3-Oct-09 11:20
protectorChristian Graus3-Oct-09 11:20 
GeneralRe: Protecting POST from an action Pin
Quake2Player3-Oct-09 11:26
Quake2Player3-Oct-09 11:26 
GeneralRe: Protecting POST from an action Pin
Christian Graus3-Oct-09 11:52
protectorChristian Graus3-Oct-09 11:52 
GeneralRe: Protecting POST from an action Pin
Abhishek Sur3-Oct-09 12:32
professionalAbhishek Sur3-Oct-09 12:32 
GeneralRe: Protecting POST from an action Pin
Abhishek Sur3-Oct-09 11:59
professionalAbhishek Sur3-Oct-09 11:59 
Of course you have to check the value in session. As Christian suggested, Session is accessible only from the server. Client can only send request and after than server have to do the rest.

When user logs in to the server, the server needs to create a session object and which will remain until session timeout occurs. Until this timespan, if any request from the same client is made, the session id will exist in the server and you can easily check the session value if he is logged in or not like during login :

if(login== success)
 Session["Auth"] = true;


For every request check :
if(Convert.ToBoolean(Session["Auth"]) != true)
{

 Response.Clear()
 Response.Write("Invalid");
 Response.Close();
 return;
}

Means you are removing the response sent to the client.

Quake2Player wrote:
Should I check for the session at the beggining of the POST?


yes . of course .. It should be checked as soon as the control comes to the server. You might use Page_Load or even if the action is posted to the HttpHandler you can do it in its processrequest section.

Hope its clear now.
Smile | :)

Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->

Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords
/xml>

QuestionHow can i do it? Pin
Fujiwara Gili3-Oct-09 5:18
Fujiwara Gili3-Oct-09 5:18 
AnswerRe: How can i do it? Pin
Abhishek Sur3-Oct-09 6:22
professionalAbhishek Sur3-Oct-09 6:22 
GeneralRe: How can i do it? Pin
Fujiwara Gili6-Oct-09 0:43
Fujiwara Gili6-Oct-09 0:43 
QuestionAjax UpdatePanel Not Responding Pin
helloshivshankar3-Oct-09 4:01
helloshivshankar3-Oct-09 4:01 
QuestionPrint page on client side contained in a folder by asp.net Pin
11Developer3-Oct-09 2:34
11Developer3-Oct-09 2:34 
AnswerRe: Print page on client side contained in a folder by asp.net Pin
mr_muskurahat3-Oct-09 2:39
mr_muskurahat3-Oct-09 2:39 
GeneralRe: Print page on client side contained in a folder by asp.net Pin
11Developer3-Oct-09 2:46
11Developer3-Oct-09 2:46 
GeneralRe: Print page on client side contained in a folder by asp.net Pin
sashidhar3-Oct-09 2:58
sashidhar3-Oct-09 2:58 
GeneralRe: Print page on client side contained in a folder by asp.net Pin
Christian Graus3-Oct-09 11:00
protectorChristian Graus3-Oct-09 11:00 
Questionsending email from local host Pin
kuduva3-Oct-09 2:34
kuduva3-Oct-09 2:34 
AnswerRe: sending email from local host Pin
sashidhar3-Oct-09 2:40
sashidhar3-Oct-09 2:40 
AnswerRe: sending email from local host Pin
Manas Bhardwaj3-Oct-09 2:41
professionalManas Bhardwaj3-Oct-09 2:41 
QuestionReplication Pin
Learner5203-Oct-09 0:25
Learner5203-Oct-09 0:25 
QuestionHow i can solve this sub menu enable false ? Pin
Rahad Rahman3-Oct-09 0:19
professionalRahad Rahman3-Oct-09 0:19 
AnswerRe: How i can solve this sub menu enable false ? Pin
sashidhar3-Oct-09 1:20
sashidhar3-Oct-09 1:20 
Questionadd scrolbar and horizantalbar bar to repeater control Pin
paya1pa3-Oct-09 0:08
paya1pa3-Oct-09 0:08 
AnswerRe: add scrolbar and horizantalbar bar to repeater control Pin
CoderOnline3-Oct-09 1:57
CoderOnline3-Oct-09 1:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.