I create cookies and write them to the users PC. The hard coded ones work fine, but when I dynamically create the cookie, some users are not able to have them written in.
I can't say if the reason is because they are dynamic, but I'm looking for possible solutions.
The checker sees if the cookie is null and if so writes the cookie. When the user goes back to this page, its as if the cookie was never written. Why would this be? Only happens for some users?
Question on Dynamic Cookies
Moderator: General Moderators
Code: Select all
If Request.Cookies(gamertag_prof)(gamertag_prof) = "" Then
Response.Cookies(gamertag_prof)(gamertag_prof) = "voted"
Response.Cookies (gamertag_prof).Expires = DATE + 3that's asp, not phpZamees wrote:Code: Select all
If Request.Cookies(gamertag_prof)(gamertag_prof) = "" Then Response.Cookies(gamertag_prof)(gamertag_prof) = "voted" Response.Cookies (gamertag_prof).Expires = DATE + 3
- Derfel Cadarn
- Forum Contributor
- Posts: 193
- Joined: Thu Jul 17, 2003 12:02 pm
- Location: Berlin, Germany
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
I think the correct way to write cookie in ASP is by using this look:
So test one of these:
Not to fluent in ASP tho, so it's just a shot in the dark.
Code: Select all
Request.Cookies("myCookie")Code: Select all
// alt 1
If Request.Cookies("gamertag_prof")("gamertag_prof") = "" Then
Response.Cookies("gamertag_prof")("gamertag_prof") = "voted"
Response.Cookies ("gamertag_prof").Expires = DATE + 3
// alt 2
If Request.Cookies("gamertag_prof") = Empty Then
Response.Cookies("gamertag_prof")("gamertag_prof") = "voted"
Response.Cookies ("gamertag_prof").Expires = DATE + 3
// a possible End If perhaps too?
// Request.Cookies("something").HasKeys might be worth looking into also.