How do I do cookie configuration to authenticate for various setups?

What are the best methods to configure cookies?