469,924 Members | 1,406 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,924 developers. It's quick & easy.

Cookie naming conventions

Rob
Hi,

I'm using ASP to create a persistent cookie. The following
code is used...

CODE_STARTS
....
'and set up our cookie...
Response.Cookies("login_authorised")("username") = username
Response.Cookies("login_authorised")("firstname") = rs
("firstname")
Response.Cookies("login_authorised")("email") = rs("email")
Response.Cookies("login_authorised")("verify") =
checkstring

Response.Cookies("login_authorised").Expires = #01/01/2006#
....
CODE_ENDS

I have checked that the values are being passed in, and
that they are strings and when I run this code standalone
it works.

The problem seems to lie in IE creating two seperate
cookies. Under what circumstances would ASP force IE to
create a new cookie rather than using the existing one?

i.e. www.mydomain.com[1].txt is replaced with
www.mydomain.com[2].txt instead of being reused

Thanks in advance for any help you can give.
Jul 19 '05 #1
1 5939
rob
I've solved my own problem

....perhaps this will help someone else

I was changing a value of the cookie later on, and did not
realise that this would cause the cookie to be resent to
the browser ___without an expiry date___ , hence the
cookie was being created, but then it's expiry was being
removed, and so it only got written to the file system for
a brief moment.

thanks

rob.
-----Original Message-----
Hi,

I'm using ASP to create a persistent cookie. The followingcode is used...

CODE_STARTS
....
'and set up our cookie...
Response.Cookies("login_authorised")("username" ) = usernameResponse.Cookies("login_authorised")("firstname ") = rs
("firstname")
Response.Cookies("login_authorised")("email") = rs ("email")Response.Cookies("login_authorised")("verify") =
checkstring

Response.Cookies("login_authorised").Expires = #01/01/2006#....
CODE_ENDS

I have checked that the values are being passed in, and
that they are strings and when I run this code standalone
it works.

The problem seems to lie in IE creating two seperate
cookies. Under what circumstances would ASP force IE to
create a new cookie rather than using the existing one?

i.e. www.mydomain.com[1].txt is replaced with
www.mydomain.com[2].txt instead of being reused

Thanks in advance for any help you can give.
.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by chris.lyon | last post: by
4 posts views Thread by Cristof Falk | last post: by
7 posts views Thread by cmiddlebrook | last post: by
1 post views Thread by clintonG | last post: by
4 posts views Thread by Mark Broadbent | last post: by
3 posts views Thread by clintonG | last post: by
5 posts views Thread by rastaman | last post: by
1 post views Thread by Philipp Post | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.