Page 1 of 1

php session handling

Posted: Wed Aug 02, 2006 4:17 am
by keshari.sangram
hi friends,
I have a problem in sessiion handling .Some times its working and sometimes its not working.


these are the steps i intend to do.
Step-1
a person will filled a form ,after clicking the submiting , a session will be estblished and the data will registered in the session id,

step-1
an email will be send to his mail id with a link ,when he click his data will be stored in database,then session will be expired.

need early replay
thanks advannce

Posted: Wed Aug 02, 2006 4:35 am
by JayBird
So, what's the problem?

Posted: Wed Aug 02, 2006 4:43 am
by keshari.sangram
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

strstr(strtoupper(substr($_SERVER["OS"], 0, 3)), "WIN") ? $sep = "\\" : $sep = "/";
$sessdir = ini_get('session.save_path').$sep."tek_sessions";
if (!is_dir($sessdir)){ mkdir($sessdir, 0777);}
ini_set('session.save_path', $sessdir);
ini_set('session.cookie_lifetime',120);
$garbage_timeout = 0;
ini_set('session.gc_maxlifetime', $garbage_timeout);
session_start();


i want that SID should persist more than 4 days what to do,actually sometimes it is working and somtimes not.


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Aug 02, 2006 8:36 am
by Jenk
Keeping session data for prolonged periods of time is not advisable, use DB tables to store the information instead, with foreign keys to a user ID or similar.