UREGENT HELP REQUIRED!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
almostsane
Forum Newbie
Posts: 13
Joined: Sat Jan 10, 2004 3:26 am

UREGENT HELP REQUIRED!!!

Post 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?
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post 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...
Last edited by Grim... on Tue Jun 08, 2004 6:22 am, edited 1 time in total.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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...
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Bah - I can't even work forum tags :(
almostsane
Forum Newbie
Posts: 13
Joined: Sat Jan 10, 2004 3:26 am

Post 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);
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

That has nothing to do with your host. Have a look at this: viewtopic.php?t=1157
almostsane
Forum Newbie
Posts: 13
Joined: Sat Jan 10, 2004 3:26 am

Post 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!!!
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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.
almostsane
Forum Newbie
Posts: 13
Joined: Sat Jan 10, 2004 3:26 am

Post 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!!
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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.
Post Reply