 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 8th, 2004, 01:39 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hello,
as I told you,if a user has two pages from our site at the same time and suppose he just works on one of them(page1) so the second page after 1201 seconds goes to ExpiredSession.asp page while the session time-out hasnt expire yet...
its not a good happening while a user works on page1 suddenly page2 goes to ExpiredSession.asp page.
I think I should prevent this happening in a way???!!!
--------------------------------------------
Mehdi.:)
|
|

September 8th, 2004, 03:37 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Session handling seems to be one of the most misunderstood topics - and yet it is so very important to web developers. It amazes me. Simple trial and error shuld answer all of your session questions. But, alas...
A browser hits a site. The site creates a unique identifier (ID), allocates some memory on the server (the session), and tags this memory with this ID. The server places this ID in the response header, and this "cookie" is passed back to the client browser. This cookie is timestamped (it will time out in 20 minutes.)
All subsequent requests from the browser to the server contain this ID. The server uses this ID and tries to find the block of memory it belongs to. It find the memory. Hence, the session is still alive, the cookie is given a fresh timestamp (a new 20 minute timeout), and sent back to the browser with the rest of the page.
Browsers that are spawned from this browser share the cookie (they pass the same ID back and forth to the server.) Every request resets the 20 minute timer.
If you go to lunch for 60 minutes, come back, and hit the site, your ID cannot be found by the server, so it creates a new session (and you handle this and make the use login again, etc...) Your session may have expired on the server - and in the simpleist of environments, fired a SessionEnd event, whereby you could have logged this into a database. But, this is the server side, so it has no idea what the client side is or isn't doing.
It is as simple as that.
Given this information - the SessionEnd Event CAN NEVER do anything to the browser - because the browser is CLIENT SIDE. The SessionEnd is completely unrelated to what the browser is doing.
<advanced>
Moreover, in an environment where a State Server (or SQL Server) is being used to store session information - there will NEVER be a SessionEnd event fired, because the session expires on an independent server, and there is no place to send the event. And even if it was fired - it still has nothing to do with the browser.
</advanced>
|
|

September 9th, 2004, 05:20 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I didnt see anything could have a connection to my previous post,
(anyway Tnx for your info,plz read my previous post)
--------------------------------------------
Mehdi.:)
|
|

September 9th, 2004, 01:56 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
quote:I didnt see anything could have a connection to my previous post
|
??? You must have read a different reply than I read.
The post by us7892 was meant to explain the concepts behind sessions, timeout and the stateless nature of the web. Once you understand these concepts in depth, you can answer your own questions on this topic.
Like I said in *my* previous post, if you check for a timeout session, there is no need to display a time-out message to the user. Since the session hasn't timed out, you can send the user where-ever he wants, including the same page he was looking at.
I think you're trying to find a fix for a problem that will not occur very often. But if it does occur, there are ways to code around it. What is it that you do not understand / cannot implement with the current suggestions?
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Bathtime by Tindersticks (Track 14 from the album: Curtains) What's This?
|
|

September 9th, 2004, 02:40 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
|
|
by knowing all the things us7892 told(thanks to him)
Quote:
quote:Originally posted by mehdi62b
as I told you,if a user has two pages from our site at the same time and suppose he just works on one of them(page1) so the second page after 1201 seconds goes to ExpiredSession.asp page while the session time-out hasnt expire yet...
its not a good happening while a user works on page1 suddenly page2 goes to ExpiredSession.asp page.
I think I should prevent this happening in a way???!!!
|
is it unclear?
--------------------------------------------
Mehdi.:)
|
|

September 9th, 2004, 03:24 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Not to me, but it seems things are unclear to you.
Like I said, in the page that the user is taken to automatically (from within your "first window"), simply check if the session has expired or not. If it hasn't simply redirect the user to the same page (e.g. reload the page), where the page will sit and wait for the next 1201 seconds.
If you don't like the user being taken to another page automatically, then just don't use the solution I suggested.
I just don't understand what your problem is. Why can't you use the stuff that has been suggested here?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: La Musique Adoucit les Moeurs by MC Solaar (Track 11 from the album: Qui Sème le Vent Récolte le Tempo) What's This?
|
|

September 9th, 2004, 03:59 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Quote:
quote:
If you don't like the user being taken to another page automatically,
|
it was my meaning,do you know a way that prevent taking the user other pages and again refering him to the same page(page2),while our user is working on page1?
--------------------------------------------
Mehdi.:)
|
|

September 10th, 2004, 12:32 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
???? Not sure what you mean. Can you please describe in more detail what it is you're trying to do? I just don't get it.
If your intention is to redirect the user from Window1 to the same page that he is viewing in Window2, I don't think that will work, because you don't really know what page the user is viewing.
As far as the server is concerned, those two windows are not related (although they do share the same session through a cookie).
You could store the last viewed page in a session and redirect to that page, but that can quickly become quite messy.
Anyway, can you give a concrete example of this stuff? When will this happen? Why do you need to prevent the user from viewing the same page again, or being redirected to a SessionExpired page?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

September 10th, 2004, 12:51 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
Geez, I'm exausted! This sounds like conversations I have with my wife! Imar, much kudos for your patience.
J
|
|

September 10th, 2004, 01:54 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Pffff, same here. I thought I was the only one getting exhausted ;)
Then again, I limit these kind of discussions to the Wrox forums and don't take them home to my girl friend ;)
Have good weekend. I think you could use some rest.....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |