Alan
Alan

Reputation: 1637

Are multiple sub-domains ever relevant in an MVC project?

VS2013 update 4, MVC5

Still relatively new to MVC. To divide functional domains within an MVC project the use of Areas seems clear from these posts (olderSOlink, newerMVC5link).

Is there ever a reason that sub-domains would be integrated as part of a solution involving different functional domains of a given MVC project? I don't have a reason to want to make use of sub-domains, I'm just asking because I don't know if there is some advantage I should know about.

Is it even possible without great difficulty? For example, can logons transfer across sub-domains? Would there be other difficult issues to address?

At present the project I am building is 'relatively' small and will have around 5 major domains so I'm assuming Areas is the best architecture to isolate these domains, but I wanted to ask for guidance before I go too far and make decisions that would make the use of sub-domains difficult in the event there is a compelling reason to use them in a single MVC project.

Upvotes: 0

Views: 258

Answers (1)

Micaiah Wallace
Micaiah Wallace

Reputation: 1146

I generally use subdomains to separate major application functionality or if I have multiple servers that I want to be on the same domain name.

To answer your login question, if you are using the same application you will remain logged in on the whole domain (depending on your method of using sessions, the cookie will be accessible to the domain as a whole).

If you are questioning using subdomains, they are really just a naming scheme so you could categorize your 5 major applications into one domain with different paths (eg. /portal, /store, /etc..) then later you could point store.domain.com -> domain.com/store. So it's pretty flexible in the end.

Upvotes: 1

Related Questions