Since you have created a sub domain for the secure domain, you will run into issues unless you redirect all traffic to the sub domain.
The problem is this:
If you begin shopping at:
www.domain.com
a session cookie is created for that domain, this cookie is used to track the session.
when you direct to the sub domain:
sub.domain.com
this is a different domain, so a new session is started, and a new session cookie is created. The contents of the cart from www.domain.com will not transfer over.
If you direct all traffic from www.domain.com to sub.domain.com you will not run into this issue.
Also, you will not need to modify any of the redirect coding.