Jump to content

Recommended Posts

extract 1401view.php

 


<?php
ob_start();
// If session is set then use previous set session by old session id otherwise start new session
$this_is_set_session_id = isset($_GET['session_id'])?$_GET['session_id']:"";
session_id($this_is_set_session_id);
session_start();
$NumberOfSessionVariables=10;
for ($i=1; $i<=$NumberOfSessionVariables; $i++)
{
$_SESSION['14ForView'.$i]=0;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


 

extract file before 1401view

 


typical home page with only <href>, one of the <herf> will bring me to 1401view.php

 

file where you have first time set session in our example 1401view, but as i mentioned i will be setting 5 sets independently.

 

my ORIGINAL arrangement works fine, no conflict with any page, but the only problem same PC same session file. if I can get same pc different client = different session file, bingo i am fine...

 

 

I placed your

 

"

 

<?php

ob_start();

session_start();  // when first time set session

$this_is_set_session_id = session_id();

header('location:112/Home.php?session_id='.$this_is_set_session_id);

?>

"

 

in the index.php

Dear Friends,

 

I have a Grave problem please help!

 

When two or more client programs are open from the SAME computer, there are NO multiple session files but only one, thus the server uses the same data set from a single session file for all the client programs from the SAME computer, this is disaster!

 

How can I overcome, please?

 

The above story about this, but I still can't get over.

 

Now Try this

(1) For each category start session.

(2) When First time session start for each category save session id in different cookie (1 cookie for 1 category)

(3) The cookie name may be like this $_COOKIE[projecttitle_categoryname_sessionid]

(4) Now for pages for different categories when you are writting session_start(); mention session_id($_COOKIE[projecttitle_categoryname_sessionid]); before.

(5) Use session cookie (must not a persistent cookie).

Thanks,

I thought I lost you.

I will do as per you request and will keep you posted.

 

(1) I put back my index to my original status, thus have removed your earlier code.

 

(2) I put this in 14view.php

 

session_start();  // when first time set session

$this_is_set_session_id = session_id();

echo $this_is_set_session_id;

 

I opened 2 insentences of client windows, i get the same sessionid file, thus we are still back to same issue.

 

I am reading out there too but could not find a way. what do you think.

 

I tell you what simple if you are using WAMP simply create a php file with nothing put this

 

session_start();  // when first time set session

$this_is_set_session_id = session_id();

echo $this_is_set_session_id;

 

why am i so worried when user open two windows, on client process leading the the other, it leading client will receive wrong data for processing, that is the the leading client will use the lagging client's data as well.

 

and for differner categories you can generate individual session id by yourself like this

 

session_id(md5('category_name'));

session_start();

echo session_id();

 

----------------------------

 

After set cookie the code will be like this

$id = isset($_COOKIE['projectname_categoryname_sessionid'])?$_COOKIE['projectname_categoryname_sessionid']:md5('category_name');

session_id($id);

session_start();

Sorry, I think I did not express myself correctly earlier.

 

I will give you the situation:

 

Take cat 1 for example.

 

It has 10 pages, idea, collect data from page 1 till 9 and store in MySQL in Page 10.

 

Lets say One ignorent person, opens two clients from the same pc,

 

In one screen he is in page 9, in one page he is page 3, when he goes to the page 10 on earlier, he will not not only same the data collected by the first but also data altered by the second.

 

Thus what ever session id we give, as long as we did not force the each clients windows to have its own unique we will not be able to get arround.

 

Am I right, please correct me.

 

 

Friend it appers to work , but I will work out full then will keep you posted "pm" if you are not arround.

 

by the way how can we set time out for these session variables, thgough i have destroy and unset if a user does not get to the alst page, i get these orphaned files littered in the temp folder.

Friend,

 

I do this, that is, on every first page, i will set all session variable to be "" then get on.

 

I will give you situation:

 

Say 50 persons view my page(s), but they do not get to the last page(s), where my session unset and session destroy is, thus the session files are just left there untill one day i stop server and delete all these files, thus if we could set time out when we create the a session variable it will be very usefull.

 

I did it in ASP, but in PHP, I honestly do not know

My intention is not to set time out for a particular variable, but for the whole sesion file, that is after some time the file should go off, else the server computer will be collecting orphaned session files.

 

"persistent cookie", is this the client side variable you are talking about.

Dear Jitesh,

 

I am very very tired suffering from earlier shock! Well I think you have bailed me out, I will test and get back, I will sent you PM if I can ;t find you later or tom.

 

I need sleep now, if I continue i will mess my codes more. catch you later.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.