Questions tagged [session]

Denotes questions about session management in Magento.

Filter by
Sorted by
Tagged with
9
votes
1answer
1k views

keeping customers logged in after deleting var/session in magento

we are facing some problem in live site as below link. For my knowledge if we delete var/session folder, than we have to login to both frontend and backend . To solve this problem : Live site blank ...
25
votes
4answers
60k views

Magento 2 - How to get all items in cart?

At checkout page (chekout/cart) I want to edit the checkout button url destination based on cart items (link.phtml). How can I get all items in cart? I want to do this without using the API. Thanks.
27
votes
8answers
29k views

Cart dropping all items / cart session clears

A site I manage suddenly (potentially 2 weeks ago - from GA stats, and only reported now) started dropping the cart items when you view the cart, or go to checkout. The top 'mini-cart' shows the ...
19
votes
4answers
8k views

Session validation failure in Magento 1 EE v 1.14.3.x (and CE 1.9.3.x)

I'm looking after a Magento shop with 400-500 visitors and 40-50 orders per day. Recently system was upgraded from Magento EE 1.14.2.4 to Magento EE 1.14.3.2 and I noticed some strange exceptions in ...
15
votes
2answers
4k views

Autologin on frontend from the backend

See the following scenario. I have some custom module that allows the frontend user to perform some actions on some custom entities. (details are not really important). The request is that an admin ...
17
votes
1answer
3k views

Long Running Admin Page Requests Blocking Other Requests

If I'm logged into Magento's backend and perform some task that takes a long time (global search on large catalogs, long running dataflow, etc), my web browser will refuse to load other admin pages in ...
57
votes
8answers
54k views

Magento 2 backend session timeout

In Magento 1.x the backend session timeout was set via: Backend -> System -> Configuration -> Admin -> Security -> Session Lifetime (seconds) Initially, my question was how to set this ...
23
votes
2answers
31k views

What's the correct cookie config for a Magento site split across multiple instances as subdomains?

The problem A large site uses separate instances of Magento for different geographic regions so the businesses are isolated. Example: site.com north.site.com south.site.com east.site.com west.site....
8
votes
3answers
2k views

Correct way to obtain a session object?

I'm writing a payment module for Magento 2 right now and I'm checking it against the "Magento Extension Quality Program Coding Standard" CodeSniffer(https://github.com/magento/marketplace-eqp). For ...
12
votes
6answers
12k views

How to show session messages at front end in magento 2 beta

I want to show an error or success message in my magento 2 module. I have extended my front-end controller with the class name \Magento\Framework\App\Action\Action. Then I redirect client to home page ...
3
votes
1answer
3k views

Does Persistent Shopping Cart work for guest (unlogged) visitors?

I'm wondering if the settings described under persistent shopping cart work for guest (unlogged) visitors. I.e. can I set them so that when a visitor comes in, adds things to cart, closes the browser, ...
14
votes
3answers
7k views

Magento 2: Syncing Backend and Frontend State/Cache

Does Magento 2 have any systems or abstractions for managing state between the backend and the local storage on the frontend? I'm working on porting a feature for restoring a user's abandoned cart ...
8
votes
1answer
11k views

Erratic cookie-related login problem

this will be a long one... I've got a bad case of erratic login failure, due to wrong cookie management. First of all, I'm managing a closed store (B2B) in which customers have to login before they ...
19
votes
5answers
26k views

How to remove SID (session ID) from URL in Magento 2

How to remove the session ID from the URL in Magento 2 (frontend). This is the SID query parameter in the URL. For example: https://example.com/contact/?SID=sfl317buq8ru4uf4a... Removed starting ...
2
votes
3answers
4k views

No Inode space!; How to delete Magento sessions folder's contents?

Hopefully, someone can help me, A Magento website I'm managing keeps going down, I've determined it to be the fact that it has used up all of the Inode space on the server. The output to df -i is ...
1
vote
1answer
6k views

How to get global messages in compare products page, getMessagesBlock is empty

I'm trying to get global messages in compare products page, but none of the messages get rendered, instead all of them appear in any subsequent page I'm going, after producing messages with for ...
45
votes
12answers
43k views

How should I handle session files that become too numerous?

I am acting as a sysadmin for a couple of servers that hold Magento sites and occasionally they fill up with session files. I have been told that managing these files isn't something that can be done ...
16
votes
3answers
15k views

Understanding Magento Registry

I have been wondering always, where is all the registry data stored in Magento ? I know that even singleton objects are stored in the registry. And registry is just a static array variable of the ...
8
votes
2answers
6k views

customer session does not work except customer page - Magento 2

Block <?php namespace Vendor\Module\Block; class CustomerLink extends \Magento\Framework\View\Element\Template { protected $_customersession; public function __construct( \Magento\...
18
votes
8answers
61k views

“invalid form key. please refresh the page” - cannot login to admin panel

I regularly visit my site to make sure its working and noticed that images for products were not appearing, thinking it was a problem with indexing cache I tried to login to the admin panel and ...
4
votes
4answers
5k views

Magento generating aprox 20 session files per minute

I have a problem with a Magento installation. This installation is not live and as such has no traffic etc. I watched in cpanel's file manager and it appears to be generating 15-25 files per minute in ...
7
votes
4answers
3k views

Magento 2.1 admin logged in issue in session

If I logged in admin side by chrome.then if when I logged-in successfully in Mozilla for same magento instance in magento2.1 then I automatically log out in chrome and throw message Someone logged ...
3
votes
2answers
5k views

Magento 2 - How to get admin user role?

I want to get all information of user(admin) and I find this answer for M1: To get an admin user role try (assuming that user is log in) $admin_user_session = Mage::getSingleton('admin/session'); $...
2
votes
1answer
885 views

How to programmatically sign in to the administration area from a module?

I'm trying to create a module which logs in a retrieved user to the administration panel. (we're talking admins, not customers :) ) I found the following post on how to do this: How to perform auto-...
2
votes
2answers
1k views

Browser Cookies are killing our LIVE site

we have a LIVE magento site from last one year. recently we are facing very difficult problem from Browser cookies. Frontend is not opening and keep on loading and never load. we are using HTTPS ...
1
vote
1answer
1k views

Magento 1 session in database error with PHP 7.2

Updated to Magento 1.9.3.10 with PHP 7.2. If I save the sessions in db: <session_save><![CDATA[db]]></session_save> I get this error: Recoverable Error: session_module_name(): ...
1
vote
4answers
7k views

Magento Connect Manager login loop

When trying to install new extensions through Magento Connect Manager, the page shows a login prompt. Upon logging in the page will just reload without installing or doing anything. The same behavior ...
0
votes
1answer
2k views

how to set no-cache HTTP headers in controller in magento 2

I have read in Magento 2 Dev Docs for Public content we can set no-cache HTTP headers for Controllers that don’t use layouts(last line in page). Controllers that don’t use layouts should set no-...
17
votes
7answers
27k views

SOLVED - Magento 2 - Unable to login to admin (no error message) stuck at login screen

This is not a question but rather an answer to a problem that is pretty old but recurring. I remember struggling on this back in the days when I was setting up Magento 1.9 and it occurred again this ...
8
votes
3answers
938 views

Disable cart sharing between different Stores of website in Magento 2?

My website is with Three different Stores and I'd like to disable the cart sharing feature between stores. So when I switch from one store to the other store, the product in my cart shouldn't be valid ...
8
votes
2answers
17k views

Saving data to session using Magento observer function

Is it possible to store data in the Magento session or registry using the the observer function, with: Mage::getSingleton('core/session')->setFoo('bar'); //Or 'customer/session', 'admin/session' ...
2
votes
2answers
5k views

Magento 2: Ensure Message Manager Messages Show Up After a Redirct

I have the following code in a Magento controller execute method public function execute() { //... /* var $messageManager \Magento\Framework\Message\ManagerInterface $messageManager */ ...
6
votes
2answers
17k views

How to empty cart or clear session “externally”

I have a unique workflow for redeeming vouchers on our site through Magento. I have a form that users use for inputting a series of vouchers to get products. It isn't "in" Magento as a CMS page or ...
5
votes
2answers
4k views

Magento writing to tmp/magento directory

The site started throwing exceptions on both the front & backend. After disabling redis, memcached & the full page cache and reverting to using files for sessions, the site seems to function ...
1
vote
1answer
1k views

Set only last added product in the quote

In my website i have bounded the user to only add one product into the cart , however from the session quote object it loads multiple products. How can i restrict quote object to show only last added ...
13
votes
1answer
935 views

Magento varien session start very slow on category pages with MEMCACHE session storage

I am using memcache for session storage and on category pages I have noticed in new relic transactions where varien session start can take over 30 seconds. It can possibly be something to do with ...
8
votes
1answer
2k views

Very long time for Mage_Core_Model_Session_Abstract_Varien::start

We are using Magento EE 1.14.1.0 and are seeing very long times for Mage_Core_Model_Session_Abstract_Varien::start method. We tried using Memcached and Redis for session storage both with the same ...
8
votes
4answers
10k views

Sharing Sessions Between Stores with Different Domains

I have three websites on a Magento installation, each has its own domain. Now due to web-browser security you cannot access cookies from another domain, nor sessions. Somehow I need to be able to ...
3
votes
3answers
15k views

Magento Admin Session Timeout Issue

I'm having an issue with Magento CE version 1.9.0.1 with admin session timeouts. It goes like this: I log into the admin. I go to the Catalog page. I leave the window open, and after a while my ...
2
votes
2answers
7k views

Login into magento from outside of magento without ruining $_SESSION

I am trying to integrate an external site with magento, so that when a user logs into site A, magentos session cookie gets set. Currently I am doing this: <?php $email = $_POST["email"]; $...
1
vote
2answers
7k views

Share Cart and checkout pages on multi websites in Magento

I have three sites like dom1.com and dom2.com and dom3.com.I want to share there cart and checkout pages like if someone buy products from dom1 and then come to site2 so on cart page his first site ...
1
vote
2answers
8k views

Success / Error message on ajax request

Currently, I am using ajax to add an coupon to the cart. This requires a success/error message to display to the user. However, it seems that i'm unable to retrieve this error/success message ...
6
votes
1answer
186 views

How to set understory session

I have use Enterprice edition I want to set the session for magento site like Gmail. The user login, the session will set. Once user click logout button the session will destory. Other wise the the ...
5
votes
1answer
3k views

Web Crawler creates a lot of sessions

I recently noted that the table core_session is growing very fast ( +400MB ) I'm quite sure this is something abnormal. I have truncated it but after a couple of days, It is again very big. If I ...
5
votes
6answers
3k views

Maintain cart for a week in Magento 2?

I am building a Magento 2 store. The Cart is saved for one hour only, it get deleted after one hour of inactivity. Is there any setting on Magento that allow a longer (may be a week or so) cart ...
5
votes
3answers
12k views

Magento 2: how to call checkout session in controller?

Please anyone tell me, how to call checkout session in module's controller? this method doesn't work for me <?php namespace Demo\Demo\Controller\Demo; class Demo extends \Magento\Framework\App\...
4
votes
1answer
231 views

Slow Magento - Mage_Core_Model_Session

For some reason this past week my magento store has started loading slowly, particularly the time to first byte being the issue. I've disabled an extension that I installed but to no avail. I've ran ...
4
votes
1answer
2k views

Suddenly started using another logged in user's session - Magento 2

This might be too broad of a question but it is a gigantic security issue and I have no idea where to start debugging this. I was testing some features on my dev server while someone else was logged ...
3
votes
2answers
8k views

Mage::getSingleton('admin/session')->getUser() is returning null

I have a custom module in my magento (version 1.5) and it's meant to load the currently logged in admin username like this in one of my controller: $current_user = Mage::getSingleton('admin/session')-...
3
votes
1answer
721 views

Maximum execution time exceeded. Clearing cookies only solution

I am running in into this weird error on our site http://amanvida.eu. The problem is hard to recreate, and I haven't been able to pin point a cause. It does happen more often when you are logged in ...