Hi
i have a page that take some user input and save the data to the mysql database. every user identified by the userid that i bind into a session variable $_SESSION['userid'] after successful login. the page i get after a successful login, i have couple of fields to give input. i am posting the form to the same page i am taking the user input and then storing that into the database with the session userid. my problem is if i do the same activitiy several time on the page, posting the form several time, then suddenly it lost the session data i.e, $_SESSION['userid'].
any solution/advise will be highly appreciated!
Thanks.
Hassan
session lost(SOLVED)
Moderator: General Moderators
session lost(SOLVED)
Last edited by mr00047 on Mon Jan 22, 2007 5:40 am, edited 1 time in total.
Hi
hey, I have solved the problem. The reason was my server was a shared hosting. I have just added two line of code to my configure file before starting my session.
the session_save_path did the trick. it changed the session file saving directory to my own pointed directory so that my session data doesnt get messed up with others.
Thanks.
hey, I have solved the problem. The reason was my server was a shared hosting. I have just added two line of code to my configure file before starting my session.
Code: Select all
ini_set("session.gc_maxlifetime","3600");
session_save_path("my/own/sesfiles");
session_start();Thanks.