Can you please tell me how to expire a session after a fixed interval of time.(i.e if the browser is inactive for some time - say, 5 mins)
Once the session expires, and if user tries to access the page, then he is prompted for login again, am i right?
Please tell me how to solve this problem.
Thank you.
nikk
0
Light Poster
Recommended Answers
Jump to PostI don't know anything about ASP.NET but I know how to work with PHP.
Use Ajax, and you easily can solve it.
There would be a client/javascript code running on user's browser and It counts till 5 minutes, and after no activity in 5 minutes, you fire the XMLHttpRequest method/functions …
Jump to PostTo have it expired automatically, you need to configure the Application Server/Web Container properly.
Reading the session properly, and redirecting to a login page, is something you will have to do though.
The above command is the one the server will use, you can use it yourself, as …
Jump to Postin fact, all sessions will expire automatically at the rate set in the server/web app configuration.
And while there are ways to do it manually, using timers and threads in the application, why would you want to essentially replicate functionality the server provides for you?
Jump to Postthere are ways to do it manually, using timers and threads in the application
Correct, of course, I should have said
but it is not practical for your classes to automatically expire the session
instead of
but your classes will not be able to automatically expire the …
All 13 Replies
mostafadotnet
18
Junior Poster
nikk
0
Light Poster
vedmack
0
Junior Poster in Training
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
jwenting
1,889
duckman
Team Colleague
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
nikk
0
Light Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
nikk
0
Light Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
nikk
0
Light Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
nikk
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.