开发者

Customising Session ID's?

开发者 https://www.devze.com 2023-03-10 01:00 出处:网络
I\'m building a little shoppping cart in WebMatrix (C#), and I would like to know if it\'s possible to开发者_开发问答 customize session id\'s. And also, let\'s just say thatI have 2 tables, one table

I'm building a little shoppping cart in WebMatrix (C#), and I would like to know if it's possible to开发者_开发问答 customize session id's. And also, let's just say thatI have 2 tables, one table is for Orders and the other one is Cart.

The items of an order go into the Cart table, and when the person has paid for an order, then an OrderId is generated and details about that order go into the Orders table. But, how am I to know, from the Orders table, which Order corresponds to an Order Item in the Cart Table?

That's when I thought of using Session Id's. Am I doing this the right way?


First, your question.

You can customize session IDs by implementing your own ISessionIDManager.

Now, is that the right solution?

In my opinion, I would say no. I'd have an Order and OrderItem table with a 1->* relationship, and have the entirety of the Cart stored in a cookie. When it's time to check out, just read off the cookie.

0

精彩评论

暂无评论...
验证码 换一张
取 消