PDA

View Full Version : Secure URL - When does it switch?


Luke
11-02-06, 01:05 AM
I've noticed that in certain areas of my store, the &mvt:global:secure_sessionurl; variable resolves to http://www.mystore.com?Session_Id=blalbalba and other times it resolves to https://myhostssharedsecureserver.com?Session_Id=blabalba. Why is that? Is there any way for me to access JUST the store url or JUST the session id or JUST the secure store url? I hope this makes sense... if not, please say so and I will try my best to clarify.

Thanks for reading...

ILoveHostasaurus
11-02-06, 01:13 AM
It will go into secure mode on any page where customer data is needed, such as buy one now going to the checkout screen, checkout going to the checkout screen, create an account and log into an account; all other screens should remain insecure if using Merchant's tokens.

Luke
11-02-06, 01:17 AM
Do you know if any of those entities I mentioned are available though?

ILoveHostasaurus
11-02-06, 01:29 AM
You don't need tokens for just the store url, that will always just be merchant.mvc followed, optionally, by ?Screen=XYZ if it's a request for a specific screen instead of the storefront, followed optionally by any additional codes needed for that screen, such as &Product_Code=ZYX for a product (PROD) screen. Same for secure, only change there is http://www.domain.com/mm5/ becomes https://www.domain.com/mm5/

I'm not sure on the session ID, someone who knows more of the token info will need to help on that. If it's not directly available through token, I'm going to guess you could extract it out of the &mvt:global:secure_sessionurl; token using the toolkit module from:

http://www.emporiumplus.com/merchant2/merchant.mvc?Screen=PROD&Store_Code=wcw&Product_Code=1AA00223&Category_Code=WC_&Search=toolkit&Offset=&filter_cat=&exclude_word=&the_fieldlist=g.SRCH_CODE%7Cg.SRCH_NAME%7Cg.SRCH_D ESC%7Cg.SRCH_CIRCA%7Cg.SRCH_COMPANY%7Cg.SRCH_ITEMS IZE%7Cg.SRCH_ACTORS%7Cg.SRCH_DIRECTOR%7Cg.SRCH_GEN RE&range_low=&range_high=&dopowersearch=1&SRCH_CATEGORY_HF=&PowerSearch_Begin_Only=

and the gettoken function of the toolkit module to greak the field out using = as the field seperator. Such as:

<mvt:item name="toolkit" param="gettoken|global:secure_sessionurl,=,2" />

Just guessing at that, not sure if that's the correct syntax.

Luke
11-02-06, 01:42 AM
Thanks man... I will check out that module. I realize that the store url is always going to be the same... I just wanted to know if there was an entity I could use so that say if the base url changes later on, I can change it in ONE convenient location... plus my store has SEO links, so the base url is just www.mysite.com

ILoveHostasaurus
11-02-06, 01:45 AM
If you're using SEO links, or even if not, you should not need to hard code any url's in the templates as the base href picks up the Merchant-style links and the seo-style just use relative paths, such as the category links showing:

<a href="/c/&mvta:tree:code;/&mvta:tree:name;.html") class="&mvt:tree:class;">&mvt:tree:name;</a>

Luke
11-02-06, 01:49 AM
My store is in development right now, so the secure url is on a shared secure server. The reason I'm asking these questions is because of that. Right now I have my links set up exactly as you just posted. The problem is that when the store switches over to secure url, it breaks my mod_rewrite rules.

Vic - WolfPaw Computers
11-02-06, 04:07 PM
The simple solution (and best practices for an E-commerce store) is to get your own SSL certificate.

The other option is to add into your .htaccess some rules to re-write the secure URLs properly.

My store is in development right now, so the secure url is on a shared secure server. The reason I'm asking these questions is because of that. Right now I have my links set up exactly as you just posted. The problem is that when the store switches over to secure url, it breaks my mod_rewrite rules.

Luke
11-02-06, 06:30 PM
Yes... I will be buying my own secure certificate, but that will come after all development is done... I'm looking for a solution to just make it work for right now... for development purposes.

Thank you... for now, I'll just rewrite the urls correctly like you mentioned.