Copy link to clipboard
Copied
Hello,
I have created an Application in PhP/MySql. The Mysql database used by my application is hosted by my website provider. The problem is the website provider has set the Timeout of 1 minute for connection to database.So, if there is inactivity of more than 1 minute then user is logged out and he has to Login Again. To resolve this issue I want to store Username/Password as cookie in my browser, so that the user is not logged out again and again. I created by application using Dreamweaver CS4 and used its Login Server Behaviour to create my login page.I would really appreciate if someone can guide me about setting cookies in a dreamweaver created login page.
Thanks
Copy link to clipboard
Copied
You couldn't find the answer on this page?!?
Copy link to clipboard
Copied
Hi,
I tried looking at the source of this page, but couldn't get a great idea as to how can I incorporate that in my current Authentication code.I am attaching the login code that Dreamweaver created.I would appreciate if someone can throw light on modifying this code to store cookies.
Thanks
Copy link to clipboard
Copied
I don't mean "this page" literally, I meant the page that was linked to in the "this page" text. Which was a link to Google for the search term "php set cookie"
Also you can not view source code of server scripts on a rendered page.
Copy link to clipboard
Copied
Sorry, but I don't understand how setting a cookie is going to help. You said that the problem is that your host has set the timeout of database connections to 1 minute. Ideally, you should be opening and closing your database connections everytime your scripts execute so timing out should not matter. Terminating the database connection will not force the user to log in again. The SB check the state of the session variables. Perhaps it is the sessions that are timing out? If so, I believe php allows you to override the default timeout.
Copy link to clipboard
Copied
That's true. Most shared web hosts default to 20 minutes for sessions. They may or may not permit script overrides on this limit.
Copy link to clipboard
Copied
Hello,
I also tried setting up the cookies to prevent user being logged out due to inactivity but soon realized it is not going to help me, once I looked closely looked on authentication code.I then called my website provider and told them about the issue. The technical support gotten back to me telling that
they have noticed that the session path for my account was not set properly and they have set it again.This seems to have resolved the issue!
Thanks all for your help!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more