Questions tagged [customer-session]

Denotes questions regarding Magento customer session.

Filter by
Sorted by
Tagged with
0 votes
2 answers
81 views
+50

Not able to access Customer Session via custom module in Magento 2

I'm not able to access the customer session in my custom module. However, when I'm navigating my custom action to salesrep/index/account I'm able to get the customer session. But when I'm navigating ...
Bojjaiah's user avatar
  • 3,988
1 vote
1 answer
28 views

Keep cart active on logout

I'm trying to keep the cart contents alive when a user is logging out. I have Persistant Cart disabled, since I do NOT want to store it in their account. I only want the user to logout from the ...
esteemedparomomycin's user avatar
1 vote
0 answers
140 views

Trying to access array offset on value of type int in /vendor/magento/framework/Session/Validator.php on line 132

Sometimes we get this type of error in production mode my System info: Magento ver. 2.4.6-p1 Php Ver. 8.1 MariaDB 10.6 Report file(ba7302309568648563df8f4293486858d9b2cccd6e8c5a1a5b1398afd1cd5c3f) ...
Prakash saran's user avatar
0 votes
1 answer
267 views

I'm using Magento 2.4.6 and want to allow customers to log in permanently as long as I don't hit the logout button

I am trying to achieve a login duration of 2 days or (a period of time) for customers in Magento 2.4.6. I tried adjusting the "Online Session Lifetime" value to control the duration of ...
abd qam's user avatar
0 votes
1 answer
1k views

TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object

I upgraded my website from magento 2.3.6-p1 to 2.4.5-p1, When i run php unit test case for my custom module(This module overides the CreatePassword.php file from Customer module) throws error from ...
jaisa2's user avatar
  • 15
0 votes
2 answers
397 views

Magento 2 Customer Id is not updating after login

I have a form in the product view section. In this form, I am keeping the logged-in user's id hidden. First I log in as one customer and then log out from that account. Again I log in as another user, ...
Jancy Abraham's user avatar
0 votes
2 answers
2k views

Getting Customer Session null from custom module in Magento 2

I tried to get the customer session in my custom module, but it is getting null always when using <update handle="customer_update"/> in the layout file. If I comment <update handle=&...
Bojjaiah's user avatar
  • 3,988
0 votes
0 answers
132 views

Customer Session Dont work adequately

i want to get customer id in model, but customer session return null in any case. Someone can help me ? I also try to get customer id in block but doest work !
Max's user avatar
  • 11
1 vote
0 answers
186 views

Magenot 2 PWA app session time

I have a website, for which we are using PWA app, but the thing is ,I am unable to keep user logged in even after he close app. how to achieve this goal?
Rohit's user avatar
  • 70
0 votes
0 answers
46 views

Customer session is not working when i login for first time due to cacheable= true

I have created a ViewModel with below code: <?php namespace {ClassNameSpace}; class {ClassName} implements \Magento\Framework\View\Element\Block\ArgumentInterface { private $context; ...
JaduDev's user avatar
0 votes
2 answers
507 views

Customer login Session is not working on homepage due to magento block cacheable=true

Use codes: 1: $ObjectManager= \Magento\Framework\App\ObjectManager::getInstance(); $context = $ObjectManager->get('Magento\Framework\App\Http\Context'); $isLoggedIn = $context->getValue(\Magento\...
JaduDev's user avatar
0 votes
1 answer
26 views

Magento 2 how to make frontend customer logged activley for 5 days?

I have Magento 2.4.1. I want the to customer must be logged in for min 5 days once he logged in to my website. I tried with PHP setting session.gc_maxlifetime but that not working. Is there any ...
Utsav Gupta's user avatar
  • 1,243
0 votes
1 answer
251 views

Customer session variables wiped off when FPC is used

I am working on a Magento 2.4.1 extension that has some special requests where I need your advice on how to handle some technical aspects in a better way. Basically, when a user logs in or a visitor ...
iupaem's user avatar
  • 41
0 votes
1 answer
129 views

Redirect customer to previous to previous page after login

I want customers to get redirected to the page from they came from. For example Customer is on CMS page Goes to login page, logs in successfully Now I want user to get redirected to CMS page visited ...
Legred Vaz's user avatar
0 votes
1 answer
1k views

Magento 2 checkout session get empty data after payment success in success.phtml file

Magento 2 Customer logged out automatically after checkout process..After payment gateway from third party, customer logout automatically in chrome browser..It work fine in mozilaa browser.
Sonali Ghule's user avatar
0 votes
1 answer
616 views

magento 2.4 customer login time increase up to 1 year or more

i want to my customer login time increase when he is one time logged in after when he/she open browser it must logged in and i have below settings increased but not affecting in my store Go to System &...
Jaydip Patel's user avatar
0 votes
1 answer
50 views

Magento User Session

It's displaying the maintenance image. And it works fine in incognito or clear browser cache. But how to say to all customers refresh their browser cache? Cookie Lifetime is set 3600. Is there any ...
Aaron Wang's user avatar
1 vote
0 answers
135 views

Customer data not get in helper of Magento 2

We have sites in which React as Frontend and Magento 2.4 as Backend in which we are facing an issue to get customer data in helper file when a customer login into frontside React(API). Do we need to ...
Divyarajsinh Dodiya's user avatar
1 vote
0 answers
507 views

How do WeltPixel Google TagManager extension works

I am using Magento 2.3.5-p2 In it, my team have installed the WeltPixel Google Tag Manager Extension (GTM) this extension is to make the process of GTM Implementation easier the way that the GTM works ...
Mohd Farhan Bin Ramli's user avatar
1 vote
2 answers
582 views

Using Customer SessionFactory in ViewModel

I am trying to retrieve customer data from the Customer session in ViewModel. app/code/Magento/Module/ViewModel/Template.php Due to FPC enabled, the session value is not retrieved. However, when I use ...
Dexter's user avatar
  • 3,613
0 votes
0 answers
95 views

Magento 1.9 :: Customer login or signup not working

I am using Magento 1.9.4.4 CE instance for my site and due to some reasons my website's login and registration forms has stopped working and I am unable to detect the issue. Also, the session files ...
IntraPersonalLearner's user avatar
0 votes
0 answers
135 views

Magento 2 : Static Timeout for Frontend Customers

For my Magento 2 store, I want all logged in customers to log out after a fixed time of say 1 day, even if they are active on the store. How can I develop a custom module to achieve this?
Md ritzwan's user avatar
1 vote
0 answers
631 views

Magento ver. 2.4.2-p1 customer login not working in chrome browser

Dear Friends I am not able to login in magento 2 customer login and not getting any error message also. customer login working fine in firefox browser
SURENDER SINGH's user avatar
0 votes
1 answer
164 views

Magento 1.9 set exisiting address as default billing and shipping address

I'm writing some magenta 1.9 codes for set existing customer address to set as default billing and shipping address <?php $customerId = Mage::getSingleton('customer/session')->getCustomer(); $...
Suneth Kalhara's user avatar
0 votes
0 answers
204 views

Magento 2 | i see a different customer name when i login

When I try to log in from the homepage of my site I see a name different from mine. For example, instead of seeing the name John Doe I see the name Jackson appear which is not my name. This problem is ...
Jackom's user avatar
  • 473
1 vote
1 answer
964 views

Regarding Customer Automatically logged out after payment

I am facing one issue, May you please help ? I do added custom payment gateway its working fine but after payment done customer automatically gets logged out from application. What can be the issue. I ...
Shreyas Vispute's user avatar
0 votes
0 answers
268 views

Magento 2.3.7 - Customer login not working on category pages due to caching

On category pages, we have a custom code that the prices are only seen to login customers but the customer session is not working on category pages. After customer login for some categories pages ...
Ranjeet Singh's user avatar
1 vote
1 answer
996 views

Magento 2 add session/cookie value to guest customer session

How can I add a value to a guest session? I have tried with the following model session: \Magento\Customer\Model\Session and setter and getter for value like this: $this->getCustomerSession()->...
Oscar Vazquez's user avatar
0 votes
0 answers
646 views

Magento 2 Customer session logsout automatically

We are in Magento 2.3.6 version. Recently on our website, we are facing customer session logout issues randomly. Customer login redirects to the same login page without any session set. Forgot ...
Agnes's user avatar
  • 787
0 votes
0 answers
554 views

Magento 2.4 Customer Login - Refresh page

I'm running into an issue on a Magento 2.4 website with 2 websites ( the one is on a seperate subdomain ). Some customers cant login using their credentials, the page just reloads without any errors. ...
sarakinos's user avatar
  • 241
1 vote
3 answers
632 views

How to check if customer has JUST logged in or out?

I need to know if the customer has successfully logged in or logged out in the current request. I need to do it in a After plugin (after execute of LogIn and Logout from customer) How can I check it? ...
jefferson's user avatar
0 votes
0 answers
71 views

Is there any way to log in to the frontend without going through the log in page?

I am trying to implement some UI tests written in selenium. There are a number of test cases which rely on the user being logged in. If I use the frontend login form to log in, and one day I find the ...
5a5a8's user avatar
  • 1
0 votes
0 answers
16 views

Showing welcome text is wrong when switch websites - related to Session

Enviroment: Magento version 2.4.1 PHP 7.4 MariaDB 10.0.26 Setting: The website has multiple websites (2 websites) Login into Dashboard -> setting Account Sharing Options is Per websites ...
Nguyễn Hoàng Tuấn's user avatar
0 votes
1 answer
138 views

how to get custom session in magento 2?

I have tried this but this is giving empty log file. What should I do to get output for this: public function isAdmin() { $writer = new \Zend\Log\Writer\Stream( BP . '/var/log/myfile.log' ); ...
aich.khalid's user avatar
0 votes
2 answers
545 views

Current user duration or current user page count in magento 2

I have a custom module . In my observer i have to know the current user duration & current user ip in fronted . So i write the code for user ip . Now if a user visit my website i want to get is ...
Abilash Erikson's user avatar
1 vote
1 answer
627 views

Magento2 Session Logsout when a person gets back from Payment Gateway

I am facing a very weird Issue in my M2 Store, whenever a user gets back from payment gateway after successful transaction, user automatically logs out from the session and land back on cart page with ...
Sukh's user avatar
  • 21
0 votes
0 answers
130 views

Share login details on multiple websites in Magento 2

I have two websites on one Magento with two different domains. Now, when customers log in to one domain and they go to the rest domain, they must log in again. Is there any way to share log in, So, ...
David Duong's user avatar
0 votes
1 answer
431 views

Customer session isLoggedIn() not working properly due to the Magento Cache

I am checking if customer is logged in or not(also i have to display customer name) but sometimes it's not working and after flushing block_html cache it works. I have tried all possible solutions:- ...
Wakar Ahamad's user avatar
0 votes
1 answer
332 views

Customer session issue for login users in magento1.9.4.4

I have problems with front end customer login, I have checked it with same system and login with two different different customer detail on to the different-2 browsers. On chrome I have login with ...
user3811650's user avatar
3 votes
2 answers
3k views

Magento is losing customer session when returning from payment gateway

We have developed a payment plugin for Magento 2. The plugin is working correctly in our test environments and in some merchant environments but it's failing in some merchants stores due to not being ...
Esteban Filardi's user avatar
1 vote
1 answer
652 views

Magento 2.3.4 multi-store customer session transfer

I have installed Fresh Magento 2.3.4, and set multiple store with websites on sub-domains. I want customers to signin in one store and then automatically signedin on another store on sub-domain. I ...
Arsalan Ul Haq's user avatar
0 votes
1 answer
65 views

Magento2: How to get registered online customer only?

customer_list.phtml $om = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $om->create('Magento\Customer\Model\ResourceModel\Online\Grid\Collection'); $customerData = $...
Masud Shaikh's user avatar
  • 1,189
0 votes
1 answer
289 views

Store switcher gives 404 error with customer logged in and folder structure in Base URL

Did you ever face 404 Error when the customer is logged in and switching the store switch with having folder structure is Base Url? Something like, Base Url is http://examplemagento.com/b2c/ I have ...
Kazim Noorani's user avatar
1 vote
0 answers
28 views

Keeps asking to login Magento 2.3.4

Not sure if this is a bug or if this is an actual issue which is going on. I have tried to read up on few informations and tried to follow the steps. But I am not getting anywhere unfortunately. The ...
Jack Brooks's user avatar
0 votes
1 answer
19 views

When transferring data through $customerSession, I receive data locally, but not on the production

I have a custom functionality for creating an order, I want to transfer the custom LastOrderId to the success page to which the user gets after submitting the form. The controller responsible for ...
ann karsksya's user avatar
1 vote
1 answer
1k views

Magento 2.3.3 - Varnish session issue

I'm having a bug with the Varnish Caching and after investigating and searching for a solution, I'm still not able to solve the problem. The FPC is working fine most of the times, but sometimes the ...
Tiago Costa's user avatar
1 vote
0 answers
19 views

Not get logged in chrome.302 status came

I am not able to login in Chrome but able to login Firefox,Internet Explorer.I have added session time 24hrs from admin settings.Also tried with core varient.php file session code commented, but no ...
Maruti_magento2's user avatar
1 vote
1 answer
2k views

Magento 2 - Increase customer session timeout for inactivity

Customer gets logged out after 30 mins of inactivity. I want to increase it to 1 hour. Any idea how to that?
Nayem323's user avatar
  • 741
1 vote
4 answers
603 views

Magento 2.3.2 How to redirect customer on login page if he hit custom customer dashboard link in browser without login?

I have created customer dashboard custom tab and the path is 'inquiry/customer/' which is working fine. Issue is that If the user hit the direct that url in the browser without login in his account ...
Vinod Kumar's user avatar
  • 2,045
1 vote
0 answers
197 views

How to conditional show content by customer group

I have a function to get the customer group ID and in my phtml file if it equals the customer group id I show content. The issue is that when I test it in a production environment the content doesn't ...
user3685048's user avatar

1
2 3 4 5