Click here to Skip to main content
15,895,084 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Webservice multiple calls Pin
Christian Graus20-Sep-09 13:59
protectorChristian Graus20-Sep-09 13:59 
GeneralRe: Webservice multiple calls Pin
Matt Cavanagh20-Sep-09 20:55
Matt Cavanagh20-Sep-09 20:55 
QuestionImpersonation throwing exception Pin
vishwjeet20-Sep-09 6:19
vishwjeet20-Sep-09 6:19 
AnswerRe: Impersonation throwing exception Pin
Abhishek Sur20-Sep-09 7:59
professionalAbhishek Sur20-Sep-09 7:59 
GeneralRe: Impersonation throwing exception Pin
vishwjeet20-Sep-09 8:23
vishwjeet20-Sep-09 8:23 
GeneralRe: Impersonation throwing exception Pin
Abhishek Sur20-Sep-09 10:25
professionalAbhishek Sur20-Sep-09 10:25 
GeneralRe: Impersonation throwing exception Pin
vishwjeet20-Sep-09 11:33
vishwjeet20-Sep-09 11:33 
GeneralCookie is not working in IIS 6.0 Pin
prasannadotnet20-Sep-09 6:06
prasannadotnet20-Sep-09 6:06 
I have login page and a main page in the asp.net application.In web.config, session Timeout value is set as 5 mins.

My requirements are as below
1.If the main page is idle for 5 mins, the session will expire and the same page will be retained. If the user tries to do some action then it has to redirect to loginpage.
bebuggiung steps
1.comes to session end event in global.asax and the retain the main page
2.comes to session start event in global.asax after the user tries to do some action.
3.check the condition and redirects to login page


2.If the session ends at the time of some action is going in the main page(eg executing a stored procedure for a long time ) then the session has to continue upto the action gets finished.Once it is completed session timeout value has to reset as original value (5 mins)

bebuggiung steps
1. Comes to session end event and assigns the session timeout value to retain the running process in the main page.


I have used the following code to do the above requirements.It is working fine in IIS V5.1 and not working in IIs 6.0 in win 2003 server
Web.config

sessionState timeout="5" mode ="InProc" cookieless ="false"


Global.asax

void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application["Button"] = "Started";
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
HttpContext context = HttpContext.Current;
HttpCookieCollection cookies = context.Request.Cookies;
if (cookies["starttime"] == null)
{
HttpCookie cookie = new HttpCookie("starttime", DateTime.Now.ToString());
cookie.Path = "/";
context.Response.Cookies.Add(cookie);
cookie.HttpOnly = true;
Application["Button"] = "Started";
}
else
{
if (Application["Button"] == "NotClicked" || Application["Button"] == "Error")
{
context.Response.Redirect("~/Logon.aspx");
}
}
}
void Session_End(object sender, EventArgs e)
{
if (Application["Button"] == "Clicked")
{
Session.Timeout = 60;
}
else
{
Application["Button"] = "NotClicked";
}
}
}
Main Page Load
Application["Button"] = "NotClicked";

Main Page Button Click (calling sp in this button)
Application["Button"] = "Clicked";


Please any one help me out to do the same in IIS 6.0. I have tried with worker process idle time also in application pool.

What is the difference in IIS 6.0 with IIS 5.1 using the above code with cookies? Please any one reply me as soon as possible. its very urgent....

Prasanna

QuestionHow to detect the user IP? Pin
Seraph_summer20-Sep-09 4:28
Seraph_summer20-Sep-09 4:28 
AnswerRe: How to detect the user IP? Pin
Parwej Ahamad20-Sep-09 4:40
professionalParwej Ahamad20-Sep-09 4:40 
GeneralRe: How to detect the user IP? Pin
amitraj8220-Sep-09 5:15
amitraj8220-Sep-09 5:15 
GeneralRe: How to detect the user IP? Pin
Seraph_summer20-Sep-09 5:17
Seraph_summer20-Sep-09 5:17 
GeneralRe: How to detect the user IP? Pin
Parwej Ahamad20-Sep-09 5:20
professionalParwej Ahamad20-Sep-09 5:20 
GeneralRe: How to detect the user IP? Pin
Seraph_summer20-Sep-09 5:23
Seraph_summer20-Sep-09 5:23 
GeneralRe: How to detect the user IP? Pin
Parwej Ahamad20-Sep-09 5:27
professionalParwej Ahamad20-Sep-09 5:27 
GeneralRe: How to detect the user IP? Pin
Seraph_summer20-Sep-09 5:30
Seraph_summer20-Sep-09 5:30 
GeneralRe: How to detect the user IP? Pin
Parwej Ahamad20-Sep-09 5:32
professionalParwej Ahamad20-Sep-09 5:32 
NewsRe: How to detect the user IP? Pin
Abhishek Sur20-Sep-09 5:31
professionalAbhishek Sur20-Sep-09 5:31 
AnswerRe: How to detect the user IP? Pin
Abhishek Sur20-Sep-09 4:42
professionalAbhishek Sur20-Sep-09 4:42 
GeneralRe: How to detect the user IP? Pin
Seraph_summer20-Sep-09 5:04
Seraph_summer20-Sep-09 5:04 
GeneralRe: How to detect the user IP? Pin
Abhishek Sur20-Sep-09 5:24
professionalAbhishek Sur20-Sep-09 5:24 
GeneralRe: How to detect the user IP? Pin
Seraph_summer20-Sep-09 5:28
Seraph_summer20-Sep-09 5:28 
GeneralRe: How to detect the user IP? Pin
ABitSmart20-Sep-09 15:40
ABitSmart20-Sep-09 15:40 
QuestionASP.NET Login Name Problem Pin
morteza45120-Sep-09 1:50
morteza45120-Sep-09 1:50 
AnswerRe: ASP.NET Login Name Problem Pin
Abhijit Jana20-Sep-09 2:49
professionalAbhijit Jana20-Sep-09 2:49 

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.