How to maintain Login status
-
Hi All, I'm developing one application in asp.net 2.0 In that application logged in user can view the pages. If the user close the page with out signing out means how can I maintain their login status? If I use the javascript in body unload means, I have to implement this script in many of the pages. Give some better idea to solve this prob. Thanks in Advance A.Muthunagai
-
Hi All, I'm developing one application in asp.net 2.0 In that application logged in user can view the pages. If the user close the page with out signing out means how can I maintain their login status? If I use the javascript in body unload means, I have to implement this script in many of the pages. Give some better idea to solve this prob. Thanks in Advance A.Muthunagai
-
Hi All, I'm developing one application in asp.net 2.0 In that application logged in user can view the pages. If the user close the page with out signing out means how can I maintain their login status? If I use the javascript in body unload means, I have to implement this script in many of the pages. Give some better idea to solve this prob. Thanks in Advance A.Muthunagai
Muthunagai.A wrote:
If the user close the page with out signing out means how can I maintain their login status?
Are you maintaining any DB flags for user status ? Usually you need to check the session existence in each page_load. If session is not exist, redirect user to the login page.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
What do you mean by
Muthunagai.A wrote:
how can I maintain their login status
please elaborate
Yes,Maintain the username in a session,if there is a null value means,I will redirect to login page. There is no prob in that. What I want is ,if the user suddenly used the window after logged in means how can I capture their status? and how to update the Database? I updated the Databse for login status in sign out button click and session_end of Global.asax. There are many pages in my application,after login.So How to update the database when the user suddenly closed the browser window?
-
Hi All, I'm developing one application in asp.net 2.0 In that application logged in user can view the pages. If the user close the page with out signing out means how can I maintain their login status? If I use the javascript in body unload means, I have to implement this script in many of the pages. Give some better idea to solve this prob. Thanks in Advance A.Muthunagai
There is one more way Create a base class that will have a method which check the session if user is logged in or not call that method from page load of base class Now your page should derived from this base class Now if user closes the browser you want to sign out user Create a cookie like person id for the session level and check that cookie if user close the browser without sign out, then cookie will also get deleted now if he open in new browser the cookie will not be available
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
There is one more way Create a base class that will have a method which check the session if user is logged in or not call that method from page load of base class Now your page should derived from this base class Now if user closes the browser you want to sign out user Create a cookie like person id for the session level and check that cookie if user close the browser without sign out, then cookie will also get deleted now if he open in new browser the cookie will not be available
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
if the user clear the cookies means how can we maintain the status? Any other idea? other then this?
-
There is one more way Create a base class that will have a method which check the session if user is logged in or not call that method from page load of base class Now your page should derived from this base class Now if user closes the browser you want to sign out user Create a cookie like person id for the session level and check that cookie if user close the browser without sign out, then cookie will also get deleted now if he open in new browser the cookie will not be available
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
If the system suddenly hang or shoutdown means,how to maintain the login status?
-
If the system suddenly hang or shoutdown means,how to maintain the login status?
Muthunagai.A wrote:
If the system suddenly hang
Ya you should not logged out the user but at certain interval of time, If it exceeds more than 20 min(depends on business ) your session should expired so user need to logged in again.
Muthunagai.A wrote:
shoutdown means,how to maintain the login status?
If system get shut down then you should not maintain the status as logged in user. The user should not logged in by default after Restarting the machine. As there should be a new session for that user
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
if the user clear the cookies means how can we maintain the status? Any other idea? other then this?
First tell me what problem are you facing when user closes the browser without logged out. And open the application in new browser.
Muthunagai.A wrote:
if the user clear the cookies means how can we maintain the status?
If user clears the cookie he will redirect to login page
Muthunagai.A wrote:
Any other idea?
No friend, i don't see any other idea as you need to use client side state management for this as server never knows about the browser states whether it is open or closed :)
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "