Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session ID's and new windows

Status
Not open for further replies.

FesterSXS

Programmer
Joined
Feb 4, 2002
Messages
2,196
Location
GB
If a link on my site opens a new window (either by window.open or target="_blank"), does the new window have a different Session ID to the parent?

I am just wondering whether my log reports are showing unrealistic visit figures due to the same visitor appearing as multiple visitors caused by these new windows.

Hope that makes sense...

Thanks

Tony
_______________________________________________________________
 
Sessions should persist through all child windows. The one case I can think of that this wouldn't happen is if the user has cookies off, which will cause them to receive a new session cookie with every single link/server-side page refresh/etc. But this wouldn't be an issue with the child windows.

Here's an example of keeping the session id across children browsers:
Code:
<%
If Session("myVar") = "" Then
	%>
	<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>" target="_new">Click for popup</a>
	<%
	Session("MyVar") = "bob's your uncle"
Else
	Response.Write "Session Intact: " & Session("MyVar")
End If
%>

If the Session ID were differant for the child browser it would never be able to output the value because it would only ever have a value for the specified session variable after it entered the first part of the i statement and set one iteself. Instead we see that it has a value and therefore the SessionId cannot be changing.

-T

barcode_1.gif
 
Thanks for that - I should have thought to test it myself :)

If a user does have Cookies disabled - would WebTrends, for example, really interpret every new page request as a different visitor?

Tony
_______________________________________________________________
 
Hmm, I've never considered that. I would say it is likely. There are really two roads you can take on that:
a) Assume every time a new session id goes out, it's a new user
or
b) Assume every person from the same ip is really one person, one connection

My guess (accent on the g-u-e-s-s) would be that it goes down trail a, seeing every new session id going out as a new user. This would be fairly safe because IIS Session ID for every (I think) connection, even just people looking at static pages. I think stats would end up being even more inflated for rocky-dirt-road b, simply because of all the firewalls, proxys, etc.

But then again, I could be wrong, this was a blatently stated guess :) Sometimes attempting to apply logic to some caompny's business plans doesn't quite work :P

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top