Click to See Complete Forum and Search --> : Broken Cookies After Upload To GoDaddy
WindowsX
04-29-2009, 11:47 PM
I have a site that I am using cookies to manage the login and subsequent data accessibility. The problem is that once I upload the files to GoDaddy the cookies break.
I used Fiddler to see where they broke but for the life of me cant figure out why, other than possible cookie handling differences between GoDaddy's IIS7 and my test servers IIS5.1.
Basically the login/validation goes as follows:
1. Login form
2. Validation against username
a. Cookie generated based on username
3. Protection page loads to log successful login into db
a. db entry is successful
b. Cookie fails
4. Failed redirect to dashboard w/data
Using Fiddler I can see that the cookie breaks at the protected file, step 3. Its present at the time the page loads but then disappears by the end. Looking at the differences between the GoDaddy server and the test server loads I see that after the ASPSESSIONIDSCDCARDD=BGPPNHAABNHFPGBEAAAMOLEB GoDaddy cuts off where the test server passes the complete cookie information.
Any ideas?
Kuriyama
04-30-2009, 03:04 PM
Going to get the easy questions out of the way first.
When you are logging in to you actually leave your site? Is there a lifespan set on your cookies or are they being deleted the moment someone leaves your site?
itHighway2007
05-02-2009, 08:00 PM
The issue you are having is nothing to do with your file uploading or closing browser. Cookie is created on visitor computer and is not effected by any of the things you mentioned.
Make sure your script to create cookie is correct.
Example:
response.Cookies("txtiRealtySolutionCke") = "Jason Gong"
response.Cookies( "txtiRealtySolutionCke").Expires = Date + 10
If your script is okay, than check your browser settings (Browser Tools Menu > Internet Options > Privacy Tab).
WindowsX
05-07-2009, 05:00 PM
Thanks for the reply. Forgive my amateur questions. I have not really worked with cookies much before.
Would I need to write the .Expires for each variable?
For example, here is my cookie write:
Response.Cookies("value_un") = yr_un
Response.Cookies("value_ident") = yr_value_ident
Response.Cookies("value_status") = yr_Status
Response.Cookies("value_type") = Yr_Type
Response.Cookies("still") = value_entry_date
Here is my cookie read:
yr_un = request.cookies("value_un")
yr_value_ident = request.cookies("value_ident")
yr_Status = request.cookies("value_status")
Yr_Type = request.cookies("value_type")
Date_In = request.cookies("still")
Would my cookie with the .Expires look like this:
Response.Cookies("value_un") = yr_un
Response.Cookies("value_un ").Expires = Date + 10
Response.Cookies("value_ident") = yr_value_ident
Response.Cookies("value_ident").Expires = Date + 10
Response.Cookies("value_status") = yr_Status
Response.Cookies("value_status").Expires = Date + 10
Response.Cookies("value_type") = Yr_Type
Response.Cookies("value_type").Expires = Date + 10
Response.Cookies("still") = value_entry_date
Kuriyama
05-08-2009, 07:48 AM
Everyone has to start from somewhere. No problem asking questions.
Cookie information
http://www.w3schools.com/ASP/asp_cookies.asp
In the future a better way to handle this problem would be to use cookies like this.
Response.Cookies("something")("firstname") = "joe"
Response.Cookies("something")("lastname") = "cool"
Response.Cookies("something")("address") = "1 awesome lane"
Response.Cookies("somthing").Expires = Date + 10
That way you can easily manipulate groups of cookies.
meyerdp
08-23-2009, 07:39 PM
I have run into this same problem - I'm also using GoDaddy with an IIS 7.0 site and cookies cannot be retrieved. They are being set - from Firefox, I can view the cookies and they have the correct value, but when Request.Cookies (<string>) (<content>) retrieves the value, the resultant string is empty.