duplicated cookies - WeOnlyDo Discussion board

duplicated cookies (General questions)

by Klinzter, Saturday, November 14, 2009, 00:00 (5487 days ago)

hello there..
I have a web post login to my website and then I get 5 cookies but two of them have the same cookie name but with different data..

something like this

Userlogin = 6532659
Logindata = 9865323
Session = psolwksd
Tracking = 65986532
Session = 98653231

something like that is what I see in the cookies but the second session is the one that has the right data..

how can I add those cookies but the first session?

im using this but its adding everything

Dim oldcookie As HttpCookie
For Each oldcookie In Http1.Response.Cookies
Http1.Request.Cookies.Add oldcookie.Name, oldcookie.Value
Next

Re: duplicated cookies

by woddrazen, Monday, November 16, 2009, 10:27 (5485 days ago) @ Klinzter

Klinzter,


Somehow we miss your post. Sorry about that.

Why don't you put some If...Then...Else Statement inside For Each...Next Statement that sends cookies and send only cookie you want?


Drazen

Re: duplicated cookies

by Klinzter, Monday, November 16, 2009, 17:36 (5485 days ago) @ woddrazen

no problem.. how exactly would the code look like

Re: duplicated cookies

by wodDamir, Monday, November 16, 2009, 18:30 (5485 days ago) @ Klinzter

Klintzer,

Why not simply remove the specific cookie after?

Once you copy the cookies, simply iterate thru the collection and remove the first occurance of the Session cookie. Something like this:

[code] For Each cookie In wodHttp1.Request.Cookies
If cookie.Name = Session Then
wodHttp1.Request.Cookies.Remove cookie
Exit For
End If
Next[/code]

Can you try something like that?

Regards,
Damba

Re: duplicated cookies

by Klinzter, Sunday, December 06, 2009, 06:24 (5465 days ago) @ wodDamir

now that I check the code I still see duplicated cookies..
not only for session but other 4 duplicated cookies appear in the cookies.. how can I make something so it removes duplicated?

Re: duplicated cookies

by woddrazen, Sunday, December 06, 2009, 11:50 (5465 days ago) @ Klinzter

Klinzter,


Is there any chance we can connect there and duplicate your problem?


Drazen

Re: duplicated cookies

by Klinzter, Sunday, December 06, 2009, 16:57 (5465 days ago) @ woddrazen

there are about 5 duplicated cookies

Re: duplicated cookies

by woddrazen, Sunday, December 06, 2009, 18:17 (5465 days ago) @ Klinzter

Klinzter,


Can you please check is duplicate cookies received from server using IEWatch or HttpFox?

Also did you receive some problem when you send duplicate cookie?


Drazen

Re: duplicated cookies

by Klinzter, Tuesday, December 08, 2009, 19:56 (5462 days ago) @ woddrazen

with the firefox browser I dont see any duplicated cookies..

when I request a page with the software and there are duplicated cookies there it shows as if it wasnt logged in!

Re: duplicated cookies

by wodDamir, Tuesday, December 08, 2009, 20:39 (5462 days ago) @ Klinzter

Klintzer,

Did you try my suggestion how to remove the certain cookies?

Also, why don't you simply Clear the cookies collection before doing new post?

Regards,
Damba