Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Cookies expiration issue
Old 12-26-2005, 04:11 PM Cookies expiration issue
Junior Talker

Posts: 2
Trades: 0
I have been trying to resolve issue with setting cookies for 3 days and haven’t figured out this problem yet. Please help if you see any solution.

Here is the issue:


Domain1.com has file1.asp and file2.asp

File1.asp:
--------------------------------------------------------------------------
<html>
<body>
.
.
.
</body>
<img src=”http://www.Domain2.com/stats/statistics.asp">
</html>
---------------------------------------------------------------------------
File2.asp:
--------------------------------------------------------------------------
<html>
<body>
.
.
.
</body>
<img src=”http://www.Domain2.com/stats/statistics.asp">
</html>





Domain2.com has stats/statistics.asp

statistics.asp:
--------------------------------------------------------------------------
<%
.
.
.
VisitorID = 1000000
Accounted = “test”

if Request.Cookies(accountID & "_VisitorID")<>"" then
VisitorID = Request.Cookies(accountID & "_VisitorID")
else
set rs=conn.execute("SELECT MAX(VisitorID) as mVisitorID FROM tb_loger")
if rs("mVisitorID")<>"" then
VisitorID = rs("mVisitorID")+1
end if
end if

‘tt=DateAdd("m", 24, Now())
tt = Date() + 300
Response.Cookies(accountID & "_VisitorID") = VisitorID
Response.Cookies(accountID & "_VisitorID").Expires = tt

---------------------------------------------------------------------

The idea is to keep track of visitor ID while visitor goes from file1 to file2
on Domain1.com by setting cookies by Domain2.com

This works fine on Mazilla Firefox but not with IE 6.0
It seems like the cookie expires each time before it goes to the next page (from file1.asp to file2.asp) . The cookie loos the value and new VisitorID is being generated.

Any help is appreciated. Other approaches is fine but it has to be different domains (statistics.asp and file1,file2)

I'm desperate, please help
yuribar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-26-2005, 06:05 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
cookies can't be used across domains so each "hit" on domain2 is unique or it should be.

Simple answer would be to pass the session ID from domain1 to domain 2 in the image call.
.../statistics.asp?v_ID=<%=session.sessionid%>

the "GET" the id from the request collection object.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-26-2005, 06:17 PM
Junior Talker

Posts: 2
Trades: 0
Actually I'm not intend to use cookies across domains, however there is way to use cookies across domain.

I'm using cookies only within domain2.com but file that does it called from domain1.com either from the file1.asp or file2.asp. As I mentioned it work on firefox browser but not on IE. So I'm messing something or there is other way to accomplish this.
yuribar is offline
Reply With Quote
View Public Profile
 
Old 12-27-2005, 06:10 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Sessions are also cookies albeit temporary, so you are trying to maintain state across domains.
maybe FF is keeping the session temporary cookie open, because they will be retained on the server for 20 mins unless explicitly cleared, Or maybe IE is treating each request for an image from another domain as a seperate HTTP request.

If they are all .asp pages, why not use a XMLHTTP object to call a page on domain2, or include the domain2 stats page into the page you want to track. Either way you should be able to use the sessionID from D1 to track the traffic.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Cookies expiration issue
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15292 seconds with 12 queries