Setting up Sticky Session on AWS ELB for Prestashop - session

i am currently toying around with my shop hoping that i can load balance my shop.
I basically want to use the sticky session feature for my load balancer (see image below):
Unfortunately i don't know what value should i put here. This is basically where i am stuck with. As far as i know, prestashop encrypt cookies information (both name and value).
Here's a screenshot:
I have got a hunch that somehow i need to hard-code it in such a way that i creates a new cookie name and associated with a unique value for a particular session.
Can anyone help me with this? What should i do?
FYI: I am using Prestashop 1.5.4.x

I haven't found the answer on the Internet, but I managed to solve the problem for the admin section of Prestashop. You should use the option of Sticky sessions in the ELB, as you can't name the cookie that Prestashop uses. Next, you should disable the option "Check the cookie's IP address" under Administration->Preferences, but might lead to security problems. Don't know how serious.

Related

Magento : the cart is always empty

I've been looking for several days now and the problem is stil there.
I'm running the following version of Magento :1.9.0.1
I do not experience any particular problem on local (using Mamp). But on my production server my cart page (beginning of the checkout process) is always empty no matter the number of items i try to add inside my cart.
I tried lots of different solution posted on many websites but nothing seems to solve it (since this is working on local it might be a server configuration problem).
Any suggestion ?
Thank you
(Ps: English is not my main language so i'm sorry for the poor syntaxe).
Are you able to login to the site?
Just check in the backend. System->Configuration->Web->Session cookie management
Whether there is a wrong value set for cookie domain
I finally found the answer. The problem was related to a theme template module. I remove the module and it's working now.
Ty

Session is expired when working on two different projects at same time

I have two projects of sugarcrm installed on my local server, nothing wrong with that.
Now I start my first project i.e. sugarcrm in the browser, login with the credentials, and after that when I opened the second project i.e. demo_sugarcrm in the browser and login, my sugarcrm session is expired.
And same with the demo_sugarcrm also. Its session expired when I login to the sugarcrm
What is going on here, I have totally different database of both. they dont share anything except that both are on local sever.
I think adjusting unique_key is supposed to fix this, but as an alternative you could modify /etc/hosts such that 'sugarcrm' and 'demo_sugarcrm' hostnames both reference 127.0.0.1. Then you could visit http://sugarcrm and http://demo_sugarcrm. I'm sure any shared cookie mayhem would go away at that point since the browser would consider these to be distinct sites.
I believe that if you edit config.php and change the unique_key variable to be different between the two instances then you shouldn't get kicked out anymore.

Magento multi-domain checkout issues

I have a Magento install with multiple domains (domain1.com, domain2.com) sharing a single checkout URL (checkoutdomain.com). The problem is when I proceed to cart and do to the new domain I get "no items in shopping cart" error. For some reason the session/cookies aren't being passed to the checkout domain.
I'm running Magento 1.7. I've gone to system/config/web/session cookie management and tried all of the following values in the cookie domain field:
.domain.com
.domain.com/
http://www.domain.com
http://www.domain.com
Should something else go here?
I also have cookie path field blank (default) and use http only set to yes (default).
I'm not sure what else to do here.
The first place I'd check is your store setup. Remember that you can't easily share a cart across multiple Websites, only Stores and Store Views (to use Magento's nomenclature).
Assuming that's fine, your next problem is ensuring that all of the domains use the same PHP session. You can do this by telling them all to use the same session id. Cookies are an ideal solution for this, but cookies do not work across completely different domains.
This means we have to explicitly tell checkoutdomain.com to session that we wish to load. We can force Magento to load a specific session by passing the session id as the SID GET parameter. You can get this value by calling Mage::getModel("core/session")->getEncryptedSessionId().
You should set web/session/use_frontend_sid to yes in your system configuration.
You should also keep in mind that not specifying a cookie path will make it default to the current path you are on when the cookie is set. You should default it to "/" to make sure it is being set globally for the site.

Magento User Sessions Being Mixed Up

I was wondering if anyone could help me with the following issue. On our Magento site, enterprise version 1.10.1.1, a user may log in, and it will say another person's name. Then, if you click on another link, it might go back to your name. The user sessions are clearly being confused. Apparently, this is a full-page caching problem, because our full page cache is often invalidated and, if we turn it off, the user sessions no longer mix up. However, turning it off considerably slows down the site. Switching the sessions from db storage to file storage (and vice versa) did not fix the issue. Does anyone know what the problem could be or how to solve it?
Thanks very much,
Brenda
You should check with Magento for a patch. I had a similar problem with Gift Certificate field info getting mixed up between sessions. They provided a patch that resolved the problem.
In the header.phtml file you should use this to print the user name
<?php echo $this->getChildHtml('welcome') ?>
Then, you can override the block 'Mage_Page_Block_Html_Welcome' if you wanna customize your message.
this happens when you use "Full Page Cache" because by default, magento exclude some blocks of the full page cache, and the block 'welcome' is one of they. if you are using customization code and message, the user name will be cached too, and other users will see different user names in this section.
it can be dependence on the cache issue. Try to turn cache off (go to admin, system, cache management and disable all cache).
If issue gone - you need to check cache configuration. If not - you have really session issue.
BTW, where you store sessions (files or DB or memcached?)
I found the cause related to Enterprise_PageCache_Model_Processor_Default class, my way is disable it in config.xml, edit src\app\code\core\Enterprise\PageCache\etc\config.xml:
<requests>
<!-- <cms>enterprise_pagecache/processor_default</cms>-->
</requests>
This problem was probably caused by Magento not being able to set proper session parameters if it was behind a reverse proxy cache like Varnish (I bet it was the case). Whenever using an intermediate caché system you have to make sure you are using the apropiate module in Apache to forward the X_FORWARDED_FOR http header to Magento like mod_rpaf, otherwise Magento will see al requests coming from the same IP and it will not be able to determine correct session isolation as it will think all requests come from the same client.

Magento session lost when switching to https from http

I've searched high and low for a solution to this, with no luck. My host told me they are too busy to help.
Magento 1.4.2 // SSL cert
1- When I add an item to cart, the page reloads and my item is added to cart. [good]
2- Next, I click home, and my items are no longer visible in cart sidebar. [bad]
3- Next, I click "Tops", and my items are still not visible in cart sidebar. [bad]
4- Next , I click "Bottoms" and the items show just fine.
In all cases where the cart isn't visible, I can add https to the URL and the cart loads up just fine. Can anyone help me figure out why my session is being lost between http and https?
I have all my backend web cookie settings set to "no" except for sID.
Also- When a user is logged in, the cart items ALWAYS show on the right. It's only screwy if they're a guest.
Thanks guys, if you need me to post any code let me know.
wwwdotlylifdotcom
EDIT: Here is a screenshot of my cookies session in firebug (not exactly sure what I am looking at). Hope this helps.
And here is my Session settings in magento: I have tried just about every variation of turning these on and off.
EDIT!
This issue has actually been narrowed down to a cache issue. We found out that when the cache is dumped/deleted, the website works properly. But after a few minutes of surfing the problem happens again. Does anyone have any idea? (And should i change the question title?)
I'm using a module called Lightspeed from TinyBrick, and it seems the new cache options are messing with our site. =( I'm contacting them shortly.
**EDIT Tinybricks excellent support helped us out. Thanks for all of your suggestions.
Is the session cookie being set to be HTTPS-only? That'll prevent it from being carried over to regular HTTP requests, effectively giving the user two different sessions.
You have in your screenshot two frontend cookie with two domains, one with www and an other one without. Check if you have a correct domain name in the configuration > Web tab > Cookie Management > Cookie Domain (or something close to that). If it's empty set it to ".mydomain.com" and try again.
Check if you don't have different cookie domain in your configuration in the other store views, set them to "use website".
If still doesn't work, What are the values of the fields of cookie management and the cookie validation settings
We were experiencing similar issues where our custom nav (depending on whether a user was logged in or not, was not very consistent across different pages.
We followed the suggestion # http://ka.lpe.sh/2011/06/19/magento-checking-customer-admin-is-logged-in-or-not/ to check if a user was logged base on the frontend session variable before a rendering a particular block, and it seems to have done the trick.
Perhaps you can try something similar.
Tinybricks excellent support helped us out. Thanks for all of your suggestions. This was a localized problem based off cache and a module called Lightspeed.

Resources