Page 1 of 1

UREGENT HELP REQUIRED!!!

Posted: Tue Jun 08, 2004 6:09 am
by almostsane
I need your help urgently !!

ok here is the problem

i am creating a Content managment sysytem for a client, however, i have found out that their webhost does not support Session control. long story short, here is their reply to my question i sent to help desk.
servers do not support file based sessions. Writing to /tmp
on the webserver is not permitted. The reason for that is: we have a
web
cluster, where the load of the file server is balanced by three
webserver machines. This means that you cannot save a session into a
file in /tmp on one server, as there is no guarantee that you will stay
on the same server, when another request is made.

Workaround:
Use database session handler instead. To implement database storage,
you
will need to use session_set_save_handler() to create a set of
user-level storage functions.

ok
What do they mean? what is a database session, and how do they work? what is the code to make them work
what is the

session_set_save_handler()

and how do i use it?

Posted: Tue Jun 08, 2004 6:11 am
by Grim...
Instead of putting the information in a file, put it in the database.

As for the [mysql_man]session_set_save_handler[/mysql_man], you could just look in the manual...

Posted: Tue Jun 08, 2004 6:16 am
by patrikG
http://www.zend.com/zend/tut/session.php

It's appalling that your webhosts don't know that you in php.ini you can specify which path session variables are stored in...

Posted: Tue Jun 08, 2004 6:22 am
by Grim...
Bah - I can't even work forum tags :(

Posted: Tue Jun 08, 2004 8:07 am
by almostsane
bloody heck !!!
i'm trying to use cookies, but i keep getting this error
Warning: Cannot modify header information - headers already sent by (output started at /www/clientweb/au/m/madast.com.au/login.php:10) in /www/clientweb/au/m/madast.com.au/login.php on line 38
stupid host !!

this is line 38 in the code

setcookie($cookname, $valid_user, time()+ $life);

Posted: Tue Jun 08, 2004 8:11 am
by patrikG
That has nothing to do with your host. Have a look at this: viewtopic.php?t=1157

Posted: Tue Jun 08, 2004 8:18 am
by almostsane
it does have things to do with my Host. if they simply allowed me to yse the default session stuff, then i wouldn't have any problems with it!!!

Posted: Tue Jun 08, 2004 8:30 am
by patrikG
setcookie() by itself has nothing to do with sessions. Sessions make use of cookies, but setcookie() is a seperate function. And the only thing it would store is a cookie on the client's computer, not anywhere on the server, and not in the /tmp directory. See cookies.

Posted: Tue Jun 08, 2004 8:34 am
by almostsane
I KNOW THAT!!! what i'm saying is that if i could just save the damn thing in /tmp, then i wouldn't need to stuff around trying to get it to save a cookie!!

Posted: Tue Jun 08, 2004 8:39 am
by patrikG
No reason to get excited. If you follow the link I posted above ( http://www.zend.com/zend/tut/session.php ) you will learn how to store session-related data etc in the database.