behzad Posted December 2, 2007 Share Posted December 2, 2007 I have made a client panel that client have to login in order to see what they only have to see. I have used dreamweaver. If a client logs in and they stop using it for few minutes when they go back to do more queries they get logged out. What approach should I take or what changes do I have to make. It seems that the browser stops and because of no activity I am disconnected. Ben Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 2, 2007 Share Posted December 2, 2007 Are you using sessions or cookies? If your using sessions, make sure your calling session_start at the top of each page. Quote Link to comment Share on other sites More sharing options...
behzad Posted December 2, 2007 Author Share Posted December 2, 2007 I am using Session. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 2, 2007 Share Posted December 2, 2007 It's impossible for anyone to figure out your problem without just guessing if we don't have any code to look at. You never answered my question, are you sure your calling session_start() at the top of all your pages? Quote Link to comment Share on other sites More sharing options...
behzad Posted December 2, 2007 Author Share Posted December 2, 2007 Yes I am calling session start. Someone said PHP timeout, and I put set time out to zero and it still did not work. I thing because the browser is not active it kicks me out. is there any way to make browser live or a include a page that refreshes itself for this not to happen. Or any way other than these? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 2, 2007 Share Posted December 2, 2007 Run this code, and see if it fixes the problem ini_set("session.gc_maxlifetime","7200"); Quote Link to comment Share on other sites More sharing options...
behzad Posted December 2, 2007 Author Share Posted December 2, 2007 I will use it and get back to you. Thanks Quote Link to comment Share on other sites More sharing options...
behzad Posted December 2, 2007 Author Share Posted December 2, 2007 Where should Put this. I put the code in connection file which is included into all pages and it did not work. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 2, 2007 Share Posted December 2, 2007 Put it anywhere it's going to be executed...since you put it in your connection script, it should have been executed. So the session is still dying? Hmm...I'm out of ideas for this one =/ Quote Link to comment Share on other sites More sharing options...
wsantos Posted December 2, 2007 Share Posted December 2, 2007 Its very hard to have a solution if we don't have a problem to work with. Quote Link to comment Share on other sites More sharing options...
behzad Posted December 2, 2007 Author Share Posted December 2, 2007 I have include the code for login authorization code as an image could you please look? [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 2, 2007 Share Posted December 2, 2007 Okay, look at your first lines of code <?php if (!isset($_SESSION)){ session_start(); } ?> That is saying if there are NO sessions, then call session start. That makes no sense, you want to use session start if there ARE sessions. So take away the exclamation point. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 2, 2007 Share Posted December 2, 2007 If you are on a shared host and your session data files are in the default location (ie. you have not set up your own folder and set the session save path to point to it) with all the other session data files, the shortest session.gc_maxlifetime from all the hosting accounts on that server will win. So, if it is a server that is getting a lot of session_start() statements (garbage collection runs often) or someone deliberately set session gc maxlifetime to a short value (thinking they were using it incorrectly as a logout timer) then your session data files might be getting deleted, which would end the session on the server side. Quote Link to comment Share on other sites More sharing options...
behzad Posted December 3, 2007 Author Share Posted December 3, 2007 Well I do not know what to do. It seams like it is the server. Most of the site is forms and I can not refresh the whole page. I put an image to refresh every 20 seconds but this did not work either. Back to square one again. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 3, 2007 Share Posted December 3, 2007 Did you try my suggestion? Quote Link to comment Share on other sites More sharing options...
behzad Posted December 3, 2007 Author Share Posted December 3, 2007 Yes I did. It did not let me to enter that page. I have a denial page that if you do not login correctly it tales me there. This is where it was directing me to when I did what you said. This was after I logged in and with a link went to this page. Funny thing I made a refresh page included in a page and it has kept me in still, but because it is included the whole page changes and goes to the refresh script page. Any Idea? Quote Link to comment Share on other sites More sharing options...
behzad Posted December 3, 2007 Author Share Posted December 3, 2007 O.k. I did something, I just tested it for 10Min and still o.k. I put an IFrame on top of the pages with 1px hight and width, The IFrame is a page that has Meta Tag refresh every 20 seconds. Do you think it is wise to do this or for any security reasons not wise. Thank for all you help, if it works for longer I will let you guys know. Again Thanks guys. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 3, 2007 Share Posted December 3, 2007 I honestly think you just need to keep pursuing the problem to figure out whats actually wrong with it. Don't just put a quick fix over it, because chances are it's going to come back and bite you again. Quote Link to comment Share on other sites More sharing options...
behzad Posted December 3, 2007 Author Share Posted December 3, 2007 Well You are very right. I will look into this more as I am now. Remember “desperate times call for desperate measures”. I am going to look into changing the session folder since the host is virtual and see how I go. I am going closing this thread. Thanks to all of you guys out there, where ever. You guys are the real ones. Ben Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.