Last post Jan 08, 2011 07:30 AM by sovitmittal
Jan 06, 2011 06:07 AM|blochaou_francois_1|LINK
I would like to display a modal dialog using jQuery the first time a use browse my site. My fisrt idea is to check a variable in the session. So i do this:
public ActionResult First()
if (string.IsNullOrEmpty(Session["First"] as string))
Session["First"] = "no";
In Google chrome and Firefox everything works fine but in IE it doesn't work.
Why this code doesn't work in IE?
What is the best way to display a model dialog the first time a user briwse a site in MVC2?
Jan 06, 2011 09:33 AM|Razor|LINK
In order to retrieve the Session Information tied with the client it checks for the Session ID within a special cookie saved within the browser's cookie cache. It could be that your browser has cookies disabled or the cookie/cache is corrupt (unusual but
not unheard of).
Try checking to see if cookies are enabled and if that doesn't work try deleting all cookies and your temporary internet cache to see if that resolves the issue.
Jan 06, 2011 09:44 AM|miodrag zivkovic|LINK
If you want to take care about user specific data between browser sessions you should use cookie not session.
Be aware cookies are recommended only for non-confidential data.
Happy coding! :-)
Jan 08, 2011 07:30 AM|sovitmittal|LINK
Session use the Session ID for for storing and retriving the data, and Session ID by default store at cookies, so if the cookie is not enable of the browser then session will not work.
So there are 2 way to solve this problem
1. either enable the browser cookie
2. or make the session cookieless , in case of cookieless session,SessionID will store in URL.
<sessionState cookieless="true" />