Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 7
Cannot Login to Frontend or Backend
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 

How is Magento setup to handle sessions, via filesystem or database?

We just had a client run into the same issue, and Magento was setup to let the database handle sessions (default is the filesystem). I was unable to login. It would just keep sending me to the login page, but I could see the URL was trying to parse at least. Occassionaly I would get in to the backend after trying to login 2-3 times in a row, but would still get “logged out” of the system.

To see what you have, or to change it, open up the following:

app/etc/local.xml

Look for this:

<session_save><![CDATA[db]]></session_save>

And change it to this:

<session_save><![CDATA[files]]></session_save>

If it’s already set to files, then there’s possibly another bug. After you’ve done this, make sure you delete the following directories:

var/session
var/cache

And also delete all of the items in the core_session table.

You should be able to login and stay logged in now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

That was it!  Thanks Crucial.  I did a clean install on my local Ubuntu box and tested all day without issue.  I did notice the option during install to choose filesystem or database, and I left it on filesystem.  I didn’t notice that option before when I installed it on my Win2k3 server, so I must have selected database by mistake.  And sure enough, it was set to db in local.xml.  I never would have thought to look there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 

Awesome, that looks like the issue then. I just did a search in the bug tracker and found it already listed, so hopefully this will be resolved soon since I would rather let the database handle sessions instead of the filesystem:

http://www.magentocommerce.com/bug-tracking/issue/?issue=2570

 
Magento Community Magento Community
Magento Community
Magento Community
 
Quin
Jr. Member
 
Total Posts:  5
Joined:  2008-08-06
 

I was the same problem and this is the solution

thank you very much
a question, when you say “And also delete all of the items in the core_session table.” that is in db no?

greetings

 
Magento Community Magento Community
Magento Community
Magento Community
 
MAtt*!
Jr. Member
 
Total Posts:  10
Joined:  2008-07-30
 

Thanks for your solution, this has resolved my problem also grin

Cheers
Mayy

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 
Quin - 06 August 2008 11:52 PM

a question, when you say “And also delete all of the items in the core_session table.” that is in db no?

That’s correct.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Levani
Jr. Member
 
Total Posts:  10
Joined:  2008-08-18
 

OK. I had the same problem I was not able to log in remotely, only from the local PC.

I have changes the cookies Lifetime to 86400 and everyfing fixed.

Try this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
joyously
Guru
 
Total Posts:  447
Joined:  2008-08-21
 

I couldn’t log in the admin suddenly (remote system). I tried extending cookies, seeing if the time matched, clearing cookies and cache and sessions data.

Nothing worked until I changed the local.xml file to store sessions in files instead of db. It had worked for 10 days, but suddenly quit.

What I didn’t like was there was no error message for the admin to work with.

 
Magento Community Magento Community
Magento Community
Magento Community
 
purplemine
Sr. Member
 
Total Posts:  143
Joined:  2008-05-20
London
 

I had exactly the same problem on a server that is already successfully running a copy without problem.  On this new install I was kicked out of the admin after about 12 hours, and changing the session to files sorted the problem out straight away.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kenandrews420
Jr. Member
 
Total Posts:  1
Joined:  2008-09-08
 

You can also try to increase Cookie Lifetime setting in Magento configuration (System -> Web -> Session Cookie Management section). 86400 should be enough to override any wrong timezone shifts.

What file is this setting located in?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael_1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 
kenandrews420 - 08 September 2008 08:04 AM

You can also try to increase Cookie Lifetime setting in Magento configuration (System -> Web -> Session Cookie Management section). 86400 should be enough to override any wrong timezone shifts.

What file is this setting located in?

It’s not a file. It’s system configuration page in Magento admin.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tperkins
Jr. Member
 
Total Posts:  10
Joined:  2008-08-06
 
kenandrews420 - 08 September 2008 08:04 AM

You can also try to increase Cookie Lifetime setting in Magento configuration (System -> Web -> Session Cookie Management section). 86400 should be enough to override any wrong timezone shifts.

What file is this setting located in?

If you can’t get into the admin area (which probably is the case). You can change this setting in the database, its in the “core_config_data” table.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tperkins
Jr. Member
 
Total Posts:  10
Joined:  2008-08-06
 

Crucial’s fix worked!!!! I’m so relieved. Thank you.

Can anyone say why this works, or why using the database to store sessions would work for about a week and all of a sudden not.

 
Magento Community Magento Community
Magento Community
Magento Community
 
RPGShop
Sr. Member
 
Total Posts:  143
Joined:  2008-06-16
 

Related to this issue… my sessions directory grows forever and never deletes old sessions… It becomes huge to a point where I have to delete the directory and remaking it once a week or so. Same goes for the sessions table.

Is there some sort of cron application or feature that I’m missing that is not clearing these files and table entries?

James

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ionut
Jr. Member
 
Total Posts:  2
Joined:  2008-09-30
 

Hello,

I’ve recently ran into the some login problems. Firefox 3 was logging in fine, but IE7 and Chrome validated the login (no error message) but did not forward to admin area. I’m running magento 1.1.6 on a CentOS 5.2 box.

Did some digging and found out that changing the session name does not occur when it should (it should be right at the beginning of the request), Firefox is fine with this, other browsers are not.

This is why at every page refresh/submit you get a new session (even if it has the same name). This is also the reason why the session dir gets so quickly populated.

I leave it to the developers to fix this problem, but for the rest of us, a workaround for this is to modify magento\app\code\core\mage\core\model\session\abstract\Varien.php at line 71 and comment it out. That means replacing

session_name($sessionName);
with
//session_name($sessionName);

I hope this saves you some time. I didn’t have time to look into this very much so use this at your on risk.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 7