473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

'fork' a session

I am working on a webbased application (not a website) and from a page
a new instance of the browser is started (using javascript) offering a
different set of functionalities. What I want is that each new
instance of the browser continues with its own set of
sessionvariables, as two different sessions. Is that possible?

I use the following javascript function:

window.open('code.php?submit=new&id=1,'status=no')

I use session_start() at the beginning of every page, i also
considered using session_regenerate_id in various ways but this didn't
have the desired effect.

Is there anyone who knows a solution to this problem?

Louis

Jul 17 '05 #1
3 1964
Louis,
I am working on a webbased application (not a website) and from a page
a new instance of the browser is started (using javascript) offering a
different set of functionalities. What I want is that each new
instance of the browser continues with its own set of
sessionvariables, as two different sessions. Is that possible?

I use the following javascript function:

window.open('code.php?submit=new&id=1,'status=no')

I use session_start() at the beginning of every page, i also
considered using session_regenerate_id in various ways but this didn't
have the desired effect.


You would have to write your own session management routines inorder to
do this. I am really not sure as to why you would want to do something
like this however I wish you the best of luck.

Mike
Jul 17 '05 #2
Lolo wrote:
I am working on a webbased application (not a website) and from a page
a new instance of the browser is started (using javascript) offering a
different set of functionalities. What I want is that each new
instance of the browser continues with its own set of
sessionvariables, as two different sessions. Is that possible?

I use the following javascript function:

window.open('code.php?submit=new&id=1,'status=no')

I use session_start() at the beginning of every page, i also
considered using session_regenerate_id in various ways but this didn't
have the desired effect.


If you are storing your session id in a cookie, then there can only be one
session per cookie store (if you run two different browsers, say Opera and
Firefox, each will have a seperate session). I am not aware of any way of
differentiating between browser windows (and I have looked).

Solutions:

1) Don't store the session id in a cookie - use the rewriting mechanism (not
the most reliable if you're doing a lot of javascript)

2) Treat $_SESSION as an array of session variables, and pass a unique index
through each web page e.g.
<?php
$actual_session=$_SESSION[$_REQUEST['workspace']];

....
$_SESSION[$_REQUEST['workspace']]=$actual_session;
?>
(this is the solution I used in PfP Studio)

HTH

C.
Jul 17 '05 #3
Colin McKinnon wrote:
<snip>
If you are storing your session id in a cookie, then there can only be one session per cookie store (if you run two different browsers, say Opera and Firefox, each will have a seperate session). I am not aware of any way of differentiating between browser windows (and I have looked).

<snip>

FWIW, IIRC, someone here pointed out sometimes ago that
session_name() can be used to switch across (different) sessions.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Benoit Dejean | last post by:
hello, i have a question about forking processes atm, i have some code which i want to rewrite os.system("cd ~ && exec " + cmd + " & disown") i want to remove this os.system call
2
by: Hoegje | last post by:
I am writing a C++ program, which should create a sub- process to start a telnet session to another server. Then it should login to that server (on the telnet login) and execute one or more...
27
by: steve | last post by:
I was given the following code, and asked what the possible outputs could be. We're learning about processes and forking. int value; int main(){ int pid, number = 1; value = 2; pid = fork();...
11
by: ramu | last post by:
Hi All, We know that a c function never returns more than one value. Then how come the fork() function returns two values? How it is implemented? Regards
1
by: chad.vice | last post by:
I have a CGIC program that generates reporting output on-the-fly. At times this generation can take a long time, and session timeouts occur while users wait for the page results to be displayed. ...
3
by: thrillseekersforever | last post by:
The questions(A&B) are to fine no# of process running from the below codes. However, I couldn't decipher the solution. Will someone please throw some light on this? Thanks a lot!! A] void...
5
by: JoeW | last post by:
Now before I go into detail I just want to say that this is purely for my own benefit and has no real world usage. I remember way back when the tool for *nix systems called forkbomb was created. I...
5
by: sandy | last post by:
I use recursive readdir as the engine for a numerous file processing routines, including generating thumbnails, using getimagesize imagecreatetruecolor and imagejpeg, etc. where each resize...
9
by: Gilles Ganault | last post by:
Hello I need to launch a Python script, and fork it so that the calling script can resume with the next step will the Python script keeps running. I tried those two, but they don't work, as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.