views:

171

answers:

2

Hi.

Trying to run an MVC app on the 'portable' web server. Software is aspnetserve. (http://www.ohloh.net/p/aspNETserve)

Cookies do not persist. They do fine when I run from visual studio debug. Code is fine, seemingly.

Only are dead (fail to persist from page to page) when I use this server.

My solution requires deploying a portable local solution like this for the app. (this isn't just being done for purposes of testing)

Rather stumped right now. Any bright ideas?

Thank you.

A: 

Could you look at the requests in fiddler. See if you are receiving cookies? In addition, do you have any special attributes set like requiressl, cookie path etc?

http://www.fiddler2.com/fiddler2/

Raj Kaimal
Interesting. My code still finds the cookie to be null -- or any session for that matter... cookie problems causing my session problems, I believe -- however fiddler shows the cookie. And a persistent asp.net session ID. It would seem, according to fiddler, that they ought to be working.They seem to be there... but accessing them results in null values. Puzzling.
DW
I realize it works fine on your dev box. Stii, what cookie are you trying to read? How are you trying to read it?
Raj Kaimal
I was surprised fiddler showed the cookie persisting considering my problems. How I'm testing: if (Request.Cookies["testcookie"] == null) { Response.Cookies["testcookie"].Value = "test"; Response.Cookies["testcookie"].Expires = DateTime.Now.AddDays(1); }and on another page, check for its existence: if (Request.Cookies["testcookie"] == null) Response.Write("bad"); else Response.Write("good");Launch from VS.. fine, returns "good". Run on aspnetserve, returns "bad."Sessions are the same deal.
DW
..and you have tried this from different browsers? Firefox, IE, Chrome, Safari?
Raj Kaimal
yes, have tried on different browsers. Most of my testing is done on chrome. (default browser)
DW
Any configuration settings that get changed when you move to the production server?
Raj Kaimal
Try using a script like this on the server. See if you are able to set/read cookies. See section on :Create cookieRead cookieErase cookiehttp://www.quirksmode.org/js/cookies.html
Raj Kaimal
Turn on tracing on the page. See the listing of cookies. http://msdn.microsoft.com/en-us/library/bb386420.aspx
Raj Kaimal
A: 

how to check cookie enabled for the browser or not in ASP.NET (MVC)

B J Patel