Forum

Problems with cooki...
 
Notifications
Clear all

Problems with cookies and session save?- SOLVED

4 Posts
4 Users
0 Likes
2,373 Views
cyanne
(@cyanne)
Posts: 13
Active Member
Topic starter
 

ETA- Figured it out and thought I'd put it here just in case anyone else runs into the same thing.

I edited the header.php where it says

if(!isset($_SESSION))
session_start();

and changed it to

if(!isset($_SESSION))  session_save_path("ouruserpath/cgi-bin/tmp");
session_start();

and then made sure that the cgi-bin/tmp directories existed and set the permissions to 755. It's now storing temporary cookies and skins changes are being remembered from page to page.


Original Problem:

I think there is something wrong with cookies not being saved on my host. Our site is http://starskyhutcharchive.net . We're using Fatcow and I'm afraid this might be an issue with this host. We're not really in a position to be able to switch hosts right now, so I'm hoping there's a way around this.

Logging in and staying in works fine. But if you select a skin and change to another page, it then reverts back to the original skin. We've tested this on both Firefox and IE on three different computers with the cookies and the cache cleared.

We're running version 3.5.1 of eFiction and PHP version 5.2.1. I checked the php information from within the Admin control panel of the eFiction install and for session.cookie_domain the Local Value and the Master Value are both showing no value. I'm not sure if this is the problem or not.

From what I've read Fatcow has disabled access to /var/php_sessions for security reasons and requires you to change the settings to your own path:

To run PHP sessions, include the following code at the top of any PHP script that uses sessions:
session_save_path("your home directory path"/cgi-bin/tmp);
session_start();

Would I need to include that in every page? I did a search for session_start and found it in a number of places. I’m hesitant to mess with the login/logout pages, since that is working. I don't mind adding it to every page if that's work it takes but I'm not sure where/how. Any help would be greatly appreciated. Thanks.

 
Posted : 12/09/2009 5:18 pm
Tammy
(@tammy)
Posts: 2577
Member Moderator
 

Did you contact your host before doing this?  Generally, they should have this setting already set for you.  If it's not, you may have other issues with your server setup.  Either way, they should know about it.

 
Posted : 13/09/2009 12:15 am
hobert
(@hobert)
Posts: 61
Trusted Member
 

I found this answer *much* more helpful.

http://www.fatcow.com/knowledgebase/read_article.bml?kbid=7090

Doing it this way will set sessions for *anything* on your domain, with no need to modify the scripts.

Kevin

efiction - 3.5.3
MySql - 5.5.32
php - 5.5.22
Linex - Apache 2.2.17
Hosted by: Fatcow!
http://www.hobert.net/fic/

 
Posted : 14/09/2009 1:40 pm
Nani
 Nani
(@nani)
Posts: 7
Active Member
 

Over 10 years later thank you, i was missing the folder "/cgi-bin/tmp" this seemed to fix my login problem

 
Posted : 12/10/2022 1:03 pm
Share: