Auto Logout ...please tell me the Answer
-
Dear all, Am loging in to my application and i didnt make any transaction, after sesstion timeout if am clicking any form that time loginpage will come, so in this regards i want login page autometically after sesstion timeout.give me solution
-
Dear all, Am loging in to my application and i didnt make any transaction, after sesstion timeout if am clicking any form that time loginpage will come, so in this regards i want login page autometically after sesstion timeout.give me solution
Your question makes no sense, you seem to say that what is happening, is what you want to happen. You also don't tell us what you mean by 'transaction', how you handle login, etc.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Your question makes no sense, you seem to say that what is happening, is what you want to happen. You also don't tell us what you mean by 'transaction', how you handle login, etc.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Have you try to understand the question, just said that it make no sense.Please dont be in hurry to answer any question first try to understand that.
-
Have you try to understand the question, just said that it make no sense.Please dont be in hurry to answer any question first try to understand that.
Am loging in to my application and i didnt make any transaction, What does he mean by 'transaction' ? How is this relevant ? How does his system allow logging in ? If we don't know what the login code is, how can we comment on it ? after sesstion timeout if am clicking any form that time loginpage will come When his session times out if he tries to do anything, then he gets a login page so in this regards i want login page autometically after sesstion timeout.give me solution Oh - I see now. OK, fair enough. It's hardly clear tho.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Dear all, Am loging in to my application and i didnt make any transaction, after sesstion timeout if am clicking any form that time loginpage will come, so in this regards i want login page autometically after sesstion timeout.give me solution
OK, I managed to decipher this, I THINK. To get the login page to show automatically, you need a javascript timer which fires after the same time as a timeout, and refreshes the page. Then the login page will show. This is rarely what users want, but it will work.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Dear all, Am loging in to my application and i didnt make any transaction, after sesstion timeout if am clicking any form that time loginpage will come, so in this regards i want login page autometically after sesstion timeout.give me solution
pkravikumar wrote:
after sesstion timeout if am clicking any form that time loginpage will come, so in this regards i want login page autometically after sesstion timeout.give me solution
I think he wants to login again automatically into system when session timeout and login page comes.
please don't forget to vote on the post that helped you.
-
Dear all, Am loging in to my application and i didnt make any transaction, after sesstion timeout if am clicking any form that time loginpage will come, so in this regards i want login page autometically after sesstion timeout.give me solution
Hey pkravikumar, Let me suggest what I do in your situation. 1. I would make an HTTPHandler which redirects every request for ASPX extension. 2. Whenever User Logs in to my system, I would store the UserData in Session using a SessionKey. For example :
if (Session["ID"] == null))
context.Session.Add("ID", userid); // you may have any value here.3. On every request I would check whether the requested Url leads to Login page or anyother page. If any other page, is the user Logged in already.
if (Session["ID"] == null && Request.Url.AbsolutePath != loginurl)
{
Response.Write("var w = window.parent || window; w.location='" + loginurl + "';");
Response.Flush();
Response.End();
}This will also eliminate your problem. If session Timeout occurs,
Session["ID"]
will have null in it. Thus any other request to page other thanloginurl
will lead to redirect it tologinurl
. I hope you like this solution. Other than that, If you dont want to write a Handler and want to do this in pages, you can see this url : Detecting Session Timeouts[^] Here you will find how to detect new session. :) :thumbsup::rose: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> -
OK, I managed to decipher this, I THINK. To get the login page to show automatically, you need a javascript timer which fires after the same time as a timeout, and refreshes the page. Then the login page will show. This is rarely what users want, but it will work.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
This is exactly what I did in my app and it works like a breeze. And to make the code generic, use a base Page class from which all your aspx code-behind classes derive. In the OnLoad event, use RegisterStartupScript to inject the javascript that refreshes the page. Use Session.Timeout property to determine the timeout in seconds.
protected override void OnLoad(EventArgs e) {
this.RegsiterStartupScript ("CheckTimeOut",
""
+ "window.setTimeout(\"document.forms[0].submit();\","
+ Session.Timeout * 1000 + ");"
}