cancel
Showing results for 
Search instead for 
Did you mean: 

Sessions

N/A

Sessions

When I migrated our site to ccgi all appeared to be OK; however session_start() now fails with an access denied message on /tmp/sess_<LongHexNumber> .

I have worked round this by using session_set_path("Directory") to define the location where session files are kept within our web space. This works, but I can see the directory I created filling up with many 21 byte files and I'm a tad worried that it will use up all our allotted web space in due course.

Has anyone else had problems with session files? Is there a way to do it without using up valuable webspace real estate?

TIA
Paul
11 REPLIES
JonathanW
Grafter
Posts: 2,648
Registered: 02-10-2007

Sessions

Hi,

There were a couple of small issues with sessions over the weekend, caused by the CGI issues reported via service status. These have now been resolved, and you should be able to continue using /tmp for your sessions.

Should the problems persist, I would suggest raising a ticket so that support can investigate the issue.
N/A

Sessions

I too have had a problem with php sessions since migrating over to ccgi. My loginscript just bombs out and calls repeatedly for the user to log back in. It's inconsistent and will keep the user logged in for numerous page calls but then bomb. I've never set a folder for sessions as I have relied on /tmp being the default location set up on the server itself. Oddly I have two versions of the pretty much the same script on my site, one is the main login but another runs a microsite in a subfolder. It is only the script in the subfolder that's causing the problem. The problem arose exactly at the time of migration and affects all the computers I use in various locations.
zigzak
Grafter
Posts: 63
Registered: 08-06-2007

CCGI Sessions problems with Gallery

Hi all,
Interesting reading about your sessions problems - I run the "Gallery" system - and it has exactly the same inconsistent login behavior as is described here. It makes it virtually impossible to use as every few pages (or sometimes for every page) the system "forgets" that you are logged in. Usually a couple of refreshes of the page sorts this - but it's very irritating!

While looking at the help at the Gallery website I found that the system has a built in "PHP Session Test" screen - using this screen revealed that the CCGI Server IP address alternates between 2 or more addresses and this seems to coincide with the logon information getting mixed up.

Can anyone from Force9/PlusNet provide a solution to this problem - I have already asked via Contect Us, but was told there wasn't much that could be done.

Regards,
David Spink
N/A

Sessions

I tried using the sessions to keep track of logins on a site I am working on but had the same issue, it kept "forgetting" that you were logged in. The only work around I found was to use cookies instead, that worked 100%.. No response from f9 on the issue though.
zigzak
Grafter
Posts: 63
Registered: 08-06-2007

Sessions and Load Balancing

Hi,
Force9 told me that the CCGI server uses "Load Balancing" - my (limited) understanding of this is that each time a page update is requested by the user the request could be sent to one of several physical servers. If your request is sent to the same CCGI server as the one which processed the login it works, if it's sent to one of the other ones they don't know that you've logged in and it doesn't work!
Sounds like would happen to any "session" variable.
The "Gallery" system I'm using (http://gallery.menalto.com/) clearly depends on this NOT happening - it's used by thousands of other people and I couldn't find anyone else in their help forums having the same problem as me!
Regards,
David
N/A

Sessions

It's the exact problem I have/had. Took me days to figure out it wasn't my programming at fault :roll:
zigzak
Grafter
Posts: 63
Registered: 08-06-2007

Force9 please sort your sessions out!

Ok,
So given the process of storing session data in this ways seems to be common place elsewhere - perhaps someone from Force9 can let us know why they don't/can't support it?
Regards,
David
N/A

Sessions

Don't hold your breath, I'm still waiting to find out how big a database I'm allowed to have. It's been 6 days so far and apart from being told I should upgrade to a business account if I want a bigger one, I've not been given a straight answer yet.
zigzak
Grafter
Posts: 63
Registered: 08-06-2007

Force9

I'd have to say I'm generally happy with Force9. I do feel they communicate a little more freely than many ISP's.
On some of these advanced features they do sometimes lack any particular urgency to resolve issues however.
drtodd
Dabbler
Posts: 11
Registered: 30-07-2007

Sessions

Hi - I had the same issue with PHP sessions not working as expected - so I added the 'session_save_path("path_to_local_cgi_directory");' line before i called the 'session_start();' function:


session_save_path("/files/home3/drtodd/mambo/session");
session_start();


This sorted everything for me; regardless if F9 have an issue with their /tmp directory... If you do this you can see the 'sess_<random_string>' files created in the local directory when a session is created. You might want to keep an eye on how much space these files are eating up in your webspace!

Regarding server load balancing, I believe most load balancers have the ability enable clients(your PC) to talk with the same physical machine inside a HTTP session (i.e. HTTP request comes in, the load balancer will 'hash' the client IP address and therefore always chooses real server X as long as IP address remains the same).

Rgds,
Darren
zigzak
Grafter
Posts: 63
Registered: 08-06-2007

Sessions

Hi Drtodd,
Thanks for the information - although I'm using a pre-built freeware system part of the config (which is controlled via webpage, not by altering the code directly) does allow the location of "tmp" folder to be specified. I tried altering this to a folder in my local dir but it didn't seem to help my particular situation.