State Management :: How To Abandon The Session When The User Closes The Browser Window
Jan 7, 2011How do I abandon the session when the user closes the browser window instead of pressing the logout button in ASP.Net 3.5 application.
View 5 RepliesHow do I abandon the session when the user closes the browser window instead of pressing the logout button in ASP.Net 3.5 application.
View 5 RepliesI have a website live in asp.net
now if user closes browser. the session does not get killed.
I spoke with friend and he said that cannot be done as sessions are on server.
but i see banking website who kills session when browser is closed.
I need to handle "session end" event for my web application when user closes his browser. Session is stored in Sql.
View 6 RepliesIn my ASP.NET application I need to allow only one session for a user ? When a user does login more than once, I want to get to user's previous session and abandon it. I'm keeping track of all user sessions by means of session id. But Session.Abandon is available only for the current session associated with a request and not previous sessions. I have the session id of the user's previous session but how can I end it ?
View 3 RepliesHow to capture logoff time when user closes browser (ie 8, firefox) before sessionout time in a asp.net web application
View 3 Replieson click of logout button, i want to call a web service method that will get that particular user's session and call its abandon method. But how can i pass that session variable to that web method ?
Calling of web method is done through java script.
Session.Abandon() in not working ASP.NET 2.0 (C#) in a few cases. In the same application its working fine in other places.
< sessionState
mode="StateServer"
cookieless="false"
timeout="20" />
The session mode is "SateServer".
How to get rid of Session.sessionID when abandoning the session?
Scenario : I abandon a session and create a new session again. This time the sessionID generated remains the same as earlier.
i allow my admin to login from his login page and login information verified and stored into an session after that, he visited into an client page, there is an logout button this will visible whether session has the user id or admin user id else it'll be invisible.
now the scenario is:
1. admin logged into admin page
2. then in the address bar type the client page name
3. now the client page is check whether has the userid or admin user id in Session, now the session has admin user id so, its show the Logout button.
4. from this client page, the admin clicks on Logout button, here i have Abandon the session and moved into the admin login page.5. now again admin types the same client page name in the address bar from his login page(but now he didnt logged in).6. this time i set the break point on client page_load event but its not hitting the event also its visible the Logout button also.so, how its not hitting the page_load event and why the logout button is visible after loggedout.
I have written a SP which maintains users log in and log out history,it works fine when any user logs in or clicks on log out, problem is that as per need its not to allowed to keep the screen idle for 1 minute or more then in the log out column Null value is passed.
SP
Create proc usp_trackuserlogindetails
@username varchar(50) = null,
@command int = 0
as
BEGIN
if(@command = 0)
begin
insert into userlog (USERNAME,LOGIN,LOGOUT) values (@username,Getdate(),Null)
[Code] ....
Here when user manually clicks the log out button then 1(table above) is the output.
When user leaves the screen idle then after 1 minute the page goes to the Login.aspx page if the user tries to do something on the current page,here 2(table above) is the output can i store some hard core value instead of Null like Session expire or the exact session expires time.
I am developing one aspnet application in that i am using Sessions. if user login into the application and click on logout here i am closing session.
suppose if the user doesn't click on the logout and he close the browser. how to kill the session when user closed the brower without logout
I'm not sure if this is an error or is the right work mode for sql sessions.
I'm working now with Windows 2008 R2 Web Ed. and SQL Server 2008 Web Ed.
When I close my browse and open again a new browser window I need to login again in asp.net application and a new session is created in the sessions table in sql server.
It's this normal? I remember that with Windows 2003 and SQL 2005 this doesn't happend. When I closed my browser and open inmediately a new browser window my session was retained and I could continue working without relogin.
I have been spending a better part of a week trying to track down why I am not able to clear all session variables in a web app (vs 2010, vb.net). What I have tracked it down to is that when I remove or abandon sessions that my html pages or codebehind access, it works, but for some reason in any of my class files where I use "Public Shared strConnection as String = HttpContext.Current.Session("strConnection").ToString" to access a session variable, it finds the old one and not the current one. I have to wait for it to time out, go in again, and it will find the new one.
I do not use Linq, and there is only one place in the whole web app that I place the connection string in a variable whcih is when a person logs in. It points them to the correct database. The sqlconnection is set for all of my listviews in Page_Init to make sure that they aren't using any session variable that they create on their own. Interestingly enough that if I use debug to go in each time, exit debug, enter debug again trying to access a different database, it works correct each time. I assume that debug is correctly killing the session variable for the classes for me.
I want to expire session when wndow is directly closed. I have master page.
View 4 RepliesExisting applications works fine with IE 6 and 7, the problem occurs only with IE 8. A new session is created everytime a window.open is used to open a new asp page. This does not happen in IE 6 or 7.
View 2 RepliesPhysican is accessing data for patient #1 using ASP.NET Web site with backend SQL Server database. Session state is used to persist some patient information. At the same time, he checks his email and clicks a link in the email that launches the same Web site to check on a communication concerning patient #2. In IE8 these two instances of the application share the same session id. If physican responds to communication concerning patient #2 and returns to patient #1, he will now be accessing data for patient #2.
I know about framemerging etc. but how can I launch a new browser session from the hyperlink in the email without closing or stepping on the http session for patient #1 and without having to resort to cookieless sessions?
I am sorry if this is been discussed earlier. I am having a problem maintaining the session when someone uses the same browser with multiple tab, the results gets messed up. A perfect example would be, [URL] if you open IE (or any other browser) and open two tabs and search for two different air travel itinerary and the results will completely overlapped (real mess). I know the cause for this problem (both tabs uses the same session). I would appreciate if somebody have any solution for this. I am using ASP.NET 3.5/VS 2008/VB.NETI will not be able to use Viewstate since I use a master page and pre-init event where view state is not available.
View 2 RepliesHow to keep the session variables even after closing the browser?
Everytime I close the browser, I lose all the session variables.
Is there any way to keep them?
I am using Post method to generate crystal reports. The user requirement is to show the report in a modeless pop up screen.
The session data needs to be cleared as it may at times contain a very large dataset.
One implementation I have placed in at present is - placing a button "Close Button". When user clicks close button, I am able to clean up the session content as well as close the window.
The issue I am facing is to get the handle of the modeless window when it is closed using the x button. Also, since the pop up window is modeless, the user might have moved to another screen, henceforth the parent of the popup window is already changed or out of context.
How do we clear the sesssion content when the issue condition arises?
While working with mutliple tabs of same browser, session varibles/object gets over written with latest one.
Scenario in my application:
I have to create new employee on first tab(tab #1), and updating existing employee details on second tab(tab #2).I stored employee other details in Session["dtInfo"], use it on saving the record.Now Session["dtInfo"] having details of latest tab created, i.e. tab #2. I tried to save record on tab #1, facing the problem of session gets over written.I had to check some vaules on OnInit and OnInitComplete event. But I get here wrong values in session.
How to get unique session id that generated same for all browser tabs and different and always unique when we close and open new browser in asp.net code.
View 2 RepliesI receive the error message "Error: Your session has expired. Please refresh your browser." When I export a table in ASP to Excel. I know for a fact that the correct data to export exists. Everything works fine except for this error message. I don't see how the session on a browser could run out in a matter of the one second it takes for the Excel file to pop up
View 2 RepliesSession variables are on server side. I need to clear out the server side session variables on browser close on client side. I have used a WebService and ajax call but still i am not getting the session cleared.
View 3 RepliesIs there a good way to keep the session after a user clicked reload/refresh? My boss wants this functionality, and I don't really/really don't want to use a query string...
View 2 Replies