views:

133

answers:

4

I am doing development work on a site with a strange server set up where sessions basically don't work. It's kind of a long story, but the main crux is it's a cluster of servers that are syncronized from an FTP server every few minutes. And for example, anything written to the filesystem in PHP gets deleted within 5 minutes.

So this means sessions don't work and I get some strange problems in phpMyAdmin, like it forgetting which page of a table I was on - I click 'next page' and end up back at the start again.

I've also tried SQL Buddy and am getting similar problems.

Are there any equivalents that don't use sessions? Doesn't need to be as full-featured as PMA, it's mainly for adding/editing some stuff.

+2  A: 

There's always the MySQL GUI Tools.

Mr. Smith
A: 

You can make phpmyadmin use other authentication methods

http://www.phpmyadmin.net/documentation/#authentication%5Fmodes

depends how much security u need and how restricted u are, but 'config' authentication mode with a custom .htaccess sounds like it might work for you

Neil Sarkar
No, I already checked that. Whatever authentication method you use, it still uses sessions in some way that breaks the app for me. :(
DisgruntledGoat
A: 

I don't know how hard it would be to plug this into phpMyAdmin, but PHP has a functionnality that allows sessions to be stored in another way than using files.

In your case, you already have a database server, obviously, so maybe you could create a "technical" database, and use it to store sessions ? This way, you would still be able use phpMyAdmin (which is quite a good tool), but your problem should be solved.

The PHP function you need to know to do that is session_set_save_handler :

session_set_save_handler() sets the user-level session storage functions which are used for storing and retrieving data associated with a session.

This is most useful when a storage method other than those supplied by PHP sessions is preferred. i.e. Storing the session data in a local database.

There are a couple of examples (take a look at the comments at the bottom of the page : some might be helpful)


For instance, Drupal uses this solution to store sessions into DB instead of files, by default.


Another solution would be to use memcached to store your sessions -- of course, if you don't have a memcached server at your disposal, this might be a bit harder than storing them in DB ^^


Or, of course, if you have access to your DB server via the network, you could install phpMyAdmin on your local computer, or use a tool like MySQL GUI Tools and its MySQL Query Browser.

Pascal MARTIN
A: 

I found a neat solution! SQLBuddy has a feature where you can put the password in the config file and it will use it automatically without a need to log in.

Obviously this is insecure by default, but coupled with a .htaccess and .htpasswd (which does work on the server) I've now got a secure login.

DisgruntledGoat