473,408 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how to destroy session

actually i m developing a web and in this web i want to do some interesting work. so i want to log out a user after warn him after some given time . i mean to say that when a user log in in the sigh then his time of accessing sigh will be getched from data base . and according to that database time user can access the sigh .
ex: suppose accessing time is 10 minutes. after log in our sigh person can use that sigh for given 10 min after 8 min a message will display that your time is going to expire so finish your work as soon as possible.and it is also mentioned that person can switch from any page to any other page in the sigh can perform any work or person can be idle for his time but we have to strictly log out person after fix time. so help me
i m using asp.net and ms access as database and no new technology is not needed in that project . we can only use java script in project. i have also used master page in my project .so please help me
Mar 17 '10 #1
4 1653
Frinavale
9,735 Expert Mod 8TB
You have stated a lot of things that you need to do.

What are you having problems with?
What are have you tried so far to solve the problem?

If you are looking to end a user's session then you can use the Session.Abandon Method to abandon the session that the user is currently working with....

You can set the Session to expire automatically after a given time using the web.config for the site.

Or you could store the time that the user logged in into Session and every time the page is loaded you want to compare the login time in Session to the current time to see if their time has finished.

In order to do things client side you probably also want to store the login time into a HiddenField so that you can access it from JavaScript.

You should also store the login time into the HiddenField so that you can access it in JavaScript as well.

You would then want to use the JavaScript setinterval to create a timer for when to display the message.

Be aware that the user's clock may differ from the server's clock and therefore you're going to want to store both the login time and the current time into HiddenFields to try and synchronize this as much as possible....



-Frinny
Mar 17 '10 #2
PRR
750 Expert 512MB
You can look into Session timeout.

Also for certain pages, you can check whether session is valid or not. If not then redirect. This will only happen when the user will request/ post some data to the web server.
Mar 18 '10 #3
actually i want to redirect to page after finishing the time without posting any data to server
.as you see in online exams a person is automatically log out after finishing the time .in this i want to add specific time for specific user.this is all i want .simply
i want to develop a site in which a user can work untill his time expires and after expiring he will be redirect to a page . and time for persons tp access site will be differ
Mar 22 '10 #4
Frinavale
9,735 Expert Mod 8TB
Shashank,

It's wonderful that you would like to do this.
We are here to help you through problems that you are facing but we aren't going to do the work for you

What have you tried so far?
What problems are you having?
Have you considered trying anything that I mentioned in my previous post?


-Frinny
Mar 22 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bob Bedford | last post by:
I've this code I've included in ALL my pages: session_cache_limiter('private, must-revalidate'); if(!session_is_registered("ID")){ if(!session_id()) session_start(); $UserID = 0; if...
0
by: Tuckbros | last post by:
Hi everybody, I am making a small site. This site uses sessions and I need to store pictures for each session. I solved this problem thanks to the session_set_save_handler() function. Sessions...
3
by: Derek Fountain | last post by:
The documentation says session_destroy() "destroys all of the data associated with the current session". Um, like what? The docs further say that you should remove all information in the _SESSION...
16
by: LP | last post by:
Hello, I am trying to use .NET with Excel. I installed Office 2003 and selected ..NET programming suport option, so it installed all those PIA, as MS sugests. But I can not find a way to destroy...
1
by: Shun | last post by:
Hello How to destroy an session thanks Shun
3
by: Amar | last post by:
Hi all, I want to use a cookie that will destroy after closing the browser, in my application. I am able to destroy my cookie after log out,but don't know how to destroy this when I will ...
5
by: Steve D | last post by:
I am not sure where to post this as it probably a combination of client and server script I am looking for. Basically I am trying to find out how to destroy a PHP session when the user navigates...
5
by: bnashenas1984 | last post by:
Hi I'm using IIS on windows XP SP2 just for designing my website. Everything is working fine except session_destroy. When I destroy the session with php nothing happends and session is still...
3
by: T. Wintershoven | last post by:
Hi all, After a visitor has loged in, a session is started. The session is destroyed after the visitor clicked "Log out'. When the visitor forgets to log out and closes the browser...
1
by: kummu4help | last post by:
Hi, i am posting data from a.php to b.php; a.php is something like this <html> <head> <body> <form method="post" action="b.php"> </form> </body>
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.