Quantcast
Channel: Attain Design » Development
Viewing all articles
Browse latest Browse all 22

Echo Magento Session ID

$
0
0

If you’ve set up a Magento installation with multiple domains, it’s quite likely that you’d like to carry sessions over to the different domains. This functionality is built into Magento but isn’t documented very well.

The following snippet of code will obtain the encrypted session ID used by the current session. You can then use this session ID to carry over the session to the other domains.
<?php $sessionId = Mage::getSingleton("core/session")->getEncryptedSessionId(); ?>
A simple example of a link:
<a href="http://www.domain2.com/?SID=<?php echo Mage::getSingleton("core/session")->getEncryptedSessionId(); ?>">Domain 2</a>
Source

The post Echo Magento Session ID appeared first on Attain Design.


Viewing all articles
Browse latest Browse all 22

Trending Articles