MVC Razor Need to pass a guid between each view
I have a guid that links the current customer to the company they are logging into.
What is the best way to pass this information between each view that is consistent and easy to retrieve at the Controller? I only need this at the controller since I'm passing it in with each query to my service.
I thought that storing it by cookie upon logon but I wasn't sure.
I am using the SqlMembershipProvider, can I store it within that class?
Any input would be greatly appreciated!
Use session if you need the GUID during normal page views; this keeps the cookie payload a little lighter. I usually keep a lightweight representation of the current user in memory, e.g. user ID, company ID, etc.