Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping server connection

Status
Not open for further replies.

mns9939

Programmer
Nov 21, 2001
19
US
Hi,

I have a web application written in php 4.0 running on a apache server. The scripts are on a hp unix box.
I am using direct oracle connection using OCI functions.

The problem is, when the application is kept open for more that 30 minutes or so, i lose connections. This forces the user to re-login to the system very often. As you can guess, the users are not happy about having to sign-in frequently.

I lloked at my php scripts and removed "cache-control:no-cache" and page expiration parameters from the header. Still it didn't help.

Can any one let me know what could be the problem?

Thanks,
Madhu
 
30 minutes ... that's a session problem and not a oracle problem.

you must use cookies to let your users be always logged in.

setcookie("user",$HTTP_POST_VARS[login],time()+365*24*3600,"/",$HTTP_HOST);
setcookie("password",$HTTP_POST_VARS[password],time()+365*24*3600,"/",$HTTP_HOST);

Will save the cookie valid for 1 year.

if (!session_is_registered("LOGIN_USER") && $users->check_user($HTTP_COOKIE_VARS[user],$HTTP_COOKIE_VARS[password])){
// user/password confirmed. You can do a auto-login.
}

This will do the always login thing.

to logout just set the cookie to time()
Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top