Is it possible pass an value(object type) with cookies between asp.net mvc3 applications? explain with example.
Is it possible pass an value(object type) with cookies between asp.net mvc3 applications? explain
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Provided both the MVC applications are from the same domain; yes. When you create the cookie, you should allow it to be accessed by the sub domain. This is not an MVC specific restriction, but a general web restriction.
Your browser will prevent pages from different domains from accessing each other’s cookies.
Alos the browser will prevent you from creating cookies for other domains. For example, your application lives in domaina.com and you are trying to create a cookie domainb.com will not work.
There are hacks and mods around these restrictions but they are generally not recommended.
I recommend you use a plugin/library such as https://github.com/carhartl/jquery-cookie to get the task done. There are many examples on how to use the plugin at the above url.
Cheers