Вопрос

Recently created my first httpmodule. It drops and manages a user cookie. This all works fine.

I now need to drop another cookie relating to site affiliates.

The question is, is is better practice to create 2 entirely separate httpmodules or add extra code to the existing one. The reason I ask is because the functionality is closely related (they both drop a cookie).

Это было полезно?

Решение

Why not write a Class Library that deals with cookies, then write your HttpModules that use the Cookies Class Library?

I don't believe you should join them, because they set cookies for different reasons, and it's easier to disable them individually if they aren't in the same module.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top