php session handling

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
keshari.sangram
Forum Newbie
Posts: 2
Joined: Wed Aug 02, 2006 4:05 am

php session handling

Post 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
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

So, what's the problem?
keshari.sangram
Forum Newbie
Posts: 2
Joined: Wed Aug 02, 2006 4:05 am

Post 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]
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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.
Post Reply