473,545 Members | 937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with conflicting sessions

Hopefully this is an easy question for those with more experience.

I have two separate programs that I want to use together on a website

Program A starts first and calls session_start() .

Program B is started by the user clicking on a link and it also calls
session_start() .

The session started by program B blows away the session started by program
A and program A will not work any longer.

How can I have two independent sessions that don't interfere with each
other?

Any advice or code snippets would be appreciated.

Thanks,
Dave
Jul 1 '08 #1
8 1830
Greetings, Dave.
In reply to Your message dated Tuesday, July 1, 2008, 23:53:10,
Hopefully this is an easy question for those with more experience.
I have two separate programs that I want to use together on a website
What you calling "programs" at first?
Program A starts first and calls session_start() .
Program B is started by the user clicking on a link and it also calls
session_start() .
The session started by program B blows away the session started by program
A and program A will not work any longer.
Can you please illustrate it in more presentable way?
I can't understand, how it is possible.
How can I have two independent sessions that don't interfere with each
other?
They are independent for sure.
Even more, new session will be started every time until you start to store
something in it.
Any advice or code snippets would be appreciated.
Kidding? You haven't explained anything, you haven't provided any example
illustrating your problem...
What do you expect from us? We not gonna do your work for you.
--
Sincerely Yours, AnrDaemon <an*******@free mail.ru>

Jul 1 '08 #2
AnrDaemon <an*******@free mail.ruwrote in
news:37******** **************@ freemail.ru:
Greetings, Dave.
In reply to Your message dated Tuesday, July 1, 2008, 23:53:10,
>Hopefully this is an easy question for those with more experience.
>I have two separate programs that I want to use together on a website

What you calling "programs" at first?
>Program A starts first and calls session_start() .
>Program B is started by the user clicking on a link and it also calls
session_start( ).
>The session started by program B blows away the session started by
program A and program A will not work any longer.

Can you please illustrate it in more presentable way?
I can't understand, how it is possible.
>How can I have two independent sessions that don't interfere with
each other?

They are independent for sure.
Even more, new session will be started every time until you start to
store something in it.
>Any advice or code snippets would be appreciated.

Kidding? You haven't explained anything, you haven't provided any
example illustrating your problem...
What do you expect from us? We not gonna do your work for you.

I don't want anyone to do my work for me, that's not it at all. Sometimes
a picture is worth a thousand works and a code fragment might make a
concept clearer than a narrative.

There are two working html files using PHP that I am trying to bundle
togther on one webpage using frames. The outer frame is the main part of
the page but it requires you to login and it creates a session. The
inner frame is a web-based email program that also requires you to login
and authenticate and it starts a session. This session seems to
overwrite the original one and the main program no longer works.

The question is: is there a way to establish two independent sessions
from one html/php script?

Thanks,
Dave
Jul 1 '08 #3
Dave wrote:
Hopefully this is an easy question for those with more experience.

I have two separate programs that I want to use together on a website

Program A starts first and calls session_start() .

Program B is started by the user clicking on a link and it also calls
session_start() .

The session started by program B blows away the session started by program
A and program A will not work any longer.

How can I have two independent sessions that don't interfere with each
other?

Any advice or code snippets would be appreciated.

Thanks,
Dave
Dave,

Are you looking at the same domain? If so, they should have the same
session. But that shouldn't be a problem - just store the variables you
want in the apporpriate $_SESSION values (use arrays within the
$_SESSION array to keep things cleaner).

If they are two different domains (remember - www.example.com and
example.com are considered "different" by default), you should already
have two sessions.

But without any code, it's hard to tell what you're doing. So it's even
more difficult to see what's wrong.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 2 '08 #4
Jerry Stuckle wrote:
Dave wrote:
>Hopefully this is an easy question for those with more experience.

I have two separate programs that I want to use together on a website

Program A starts first and calls session_start() .

Program B is started by the user clicking on a link and it also calls
session_start( ).

The session started by program B blows away the session started by
program A and program A will not work any longer.

How can I have two independent sessions that don't interfere with each
other?

Any advice or code snippets would be appreciated.

Thanks,
Dave

Dave,

Are you looking at the same domain? If so, they should have the same
session. But that shouldn't be a problem - just store the variables you
want in the apporpriate $_SESSION values (use arrays within the
$_SESSION array to keep things cleaner).

If they are two different domains (remember - www.example.com and
example.com are considered "different" by default), you should already
have two sessions.

But without any code, it's hard to tell what you're doing. So it's even
more difficult to see what's wrong.
One thing to note is that sessions are lost when the url is not
relative, see here:
http://us.php.net/manual/en/session.idpassing.php

Also if you are accessing session from included files the way they are
called can lose the session. For instance if url includes are allowed
and you do from a file with session_start() already called:
include "/var/www/htdocs/file1.php";
include "http://sameSite/file2.php";

the session will be available in file1 but not in file2
Jul 2 '08 #5
Johnny wrote:
Jerry Stuckle wrote:
>Dave wrote:
>>Hopefully this is an easy question for those with more experience.

I have two separate programs that I want to use together on a website

Program A starts first and calls session_start() .

Program B is started by the user clicking on a link and it also calls
session_start ().

The session started by program B blows away the session started by
program A and program A will not work any longer.

How can I have two independent sessions that don't interfere with
each other?

Any advice or code snippets would be appreciated.

Thanks,
Dave

Dave,

Are you looking at the same domain? If so, they should have the same
session. But that shouldn't be a problem - just store the variables
you want in the apporpriate $_SESSION values (use arrays within the
$_SESSION array to keep things cleaner).

If they are two different domains (remember - www.example.com and
example.com are considered "different" by default), you should already
have two sessions.

But without any code, it's hard to tell what you're doing. So it's
even more difficult to see what's wrong.
One thing to note is that sessions are lost when the url is not
relative, see here:
http://us.php.net/manual/en/session.idpassing.php
That's only if you're not using cookies. When using cookies (which
virtually everyone does), absolute or relative urls are immaterial - as
long as the domain itself is the same.
Also if you are accessing session from included files the way they are
called can lose the session. For instance if url includes are allowed
and you do from a file with session_start() already called:
include "/var/www/htdocs/file1.php";
include "http://sameSite/file2.php";

the session will be available in file1 but not in file2
True, if you do a url include. However - why would you ever do that on
your own site? It requires an additional call to the server and
additional server processing. It's much better to include it as a file
- in which case the session information is available.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 2 '08 #6
Jerry Stuckle <js*******@attg lobal.netwrote in news:g4fneo$dc$ 1
@registered.mot zarella.org:
Johnny wrote:
>Jerry Stuckle wrote:
>>Dave wrote:
Hopefully this is an easy question for those with more experience.

I have two separate programs that I want to use together on a
website
>>>>
Program A starts first and calls session_start() .

Program B is started by the user clicking on a link and it also
calls
>>>session_star t().

The session started by program B blows away the session started by
program A and program A will not work any longer.

How can I have two independent sessions that don't interfere with
each other?

Any advice or code snippets would be appreciated.

Thanks,
Dave
Dave,

Are you looking at the same domain? If so, they should have the same
session. But that shouldn't be a problem - just store the variables
you want in the apporpriate $_SESSION values (use arrays within the
$_SESSION array to keep things cleaner).

If they are two different domains (remember - www.example.com and
example.com are considered "different" by default), you should
already
>>have two sessions.

But without any code, it's hard to tell what you're doing. So it's
even more difficult to see what's wrong.
One thing to note is that sessions are lost when the url is not
relative, see here:
http://us.php.net/manual/en/session.idpassing.php

That's only if you're not using cookies. When using cookies (which
virtually everyone does), absolute or relative urls are immaterial - as
long as the domain itself is the same.
>Also if you are accessing session from included files the way they are
called can lose the session. For instance if url includes are allowed
and you do from a file with session_start() already called:
include "/var/www/htdocs/file1.php";
include "http://sameSite/file2.php";

the session will be available in file1 but not in file2

True, if you do a url include. However - why would you ever do that on
your own site? It requires an additional call to the server and
additional server processing. It's much better to include it as a file
- in which case the session information is available.
Thanks to all for their repsponse. I will work on some code changes for
next couple of days based on your input.

Thanks,
Dave
Jul 2 '08 #7
Johnny wrote:
Jerry Stuckle wrote:
>Dave wrote:
>>Hopefully this is an easy question for those with more experience.

I have two separate programs that I want to use together on a website

Program A starts first and calls session_start() .

Program B is started by the user clicking on a link and it also calls
session_start ().

The session started by program B blows away the session started by
program A and program A will not work any longer.

How can I have two independent sessions that don't interfere with
each other?

Any advice or code snippets would be appreciated.

Thanks,
Dave

Dave,

Are you looking at the same domain? If so, they should have the same
session. But that shouldn't be a problem - just store the variables
you want in the apporpriate $_SESSION values (use arrays within the
$_SESSION array to keep things cleaner).

If they are two different domains (remember - www.example.com and
example.com are considered "different" by default), you should already
have two sessions.

But without any code, it's hard to tell what you're doing. So it's
even more difficult to see what's wrong.
One thing to note is that sessions are lost when the url is not
relative, see here:
http://us.php.net/manual/en/session.idpassing.php
That's only if you're not using cookies. When using cookies (which
virtually everyone does), absolute or relative urls are immaterial - as
long as the domain itself is the same.
Also if you are accessing session from included files the way they are
called can lose the session. For instance if url includes are allowed
and you do from a file with session_start() already called:
include "/var/www/htdocs/file1.php";
include "http://sameSite/file2.php";

the session will be available in file1 but not in file2
True, if you do a url include. However - why would you ever do that on
your own site? It requires an additional call to the server and
additional server processing. It's much better to include it as a file
- in which case the session information is available.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 2 '08 #8
On Jul 2, 12:30*pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
Johnny wrote:
Jerry Stuckle wrote:
Dave wrote:
Hopefully this is an easy question for those with more experience.
>I have two separate programs that I want to use together on a website
>Program A starts first and calls session_start() .
>Program B is started by the user clicking on a link and it also calls
session_start( ).
>The session started by program B blows away the session started by
program A and program A will not work any longer.
>How can I have two independent sessions that don't interfere with
each other?
>Any advice or code snippets would be appreciated.
>Thanks,
Dave
Dave,
Are you looking at the same domain? *If so, they should have the same
session. *But that shouldn't be a problem - just store the variables
you want in the apporpriate $_SESSION values (use arrays within the
$_SESSION array to keep things cleaner).
If they are two different domains (remember -www.example.com and
example.com are considered "different" by default), you should already
have two sessions.
But without any code, it's hard to tell what you're doing. *So it's
even more difficult to see what's wrong.
One thing to note is that sessions are lost when the url is not
relative, see here:
http://us.php.net/manual/en/session.idpassing.php

That's only if you're not using cookies. *When using cookies (which
virtually everyone does), absolute or relative urls are immaterial - as
long as the domain itself is the same.
Also if you are accessing session from included files the way they are
called can lose the session. For instance if url includes are allowed
and you do from a file with session_start() already called:
include "/var/www/htdocs/file1.php";
include "http://sameSite/file2.php";
the session will be available in file1 but not in file2

True, if you do a url include. *However - why would you ever do that on
your own site? *It requires an additional call to the server and
additional server processing. *It's much better to include it as a file
- in which case the session information is available.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===- Hide quoted text -

- Show quoted text -
You could just use session_name() to set two different sessions.

so like:
session_name("p rogramA");
session_start() ; /* your $_SESSION variable are now for programA */

and in your other 'program'

session_name("p rogramB");
session_start() ; /* your $_SESSION variables are now for programB */
Although, surely you can just use different variable names in one
session??
Jul 2 '08 #9

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

Similar topics

1
1487
by: Julia Briggs | last post by:
Hello, I have these two scripts, where the first one is being canceled out by the second, they work independently, but not together (they are a auto-tab and form box character counter script) -- hopefully one can see how they are conflicting and fix a solution so they can work and mesh together. It seems the second script is canceling out the...
28
3259
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical make-believe challenge in order to avoid confusing the issue further. Suppose I was hosting a dinner and I wanted to invite exactly 12 guests from my...
7
2596
by: Thiru | last post by:
I am writing an application that interacts with Oracle and Teradata. In order to create the executable, I need to link various Oracle and Teradata libraries. I found out that when I link the Oracle and Teradata libraries together, the Teradata API functions are not working properly. My assumption is that these libraries are sharing...
12
2261
by: D. Shane Fowlkes | last post by:
This is a repost (pasted below). Since my original post, I've double checked the system clock and set all IIS Session Timeout values to 10 minutes. Still ...the problem occurs. I've also installed Deep Metrix Live Stats 6.2 XPS just to make sure nothing really strange was going on was going on. Still....the sessions only increment...or...
1
1954
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following statement. Help.ShowHelp(Parent:=Me, url:=Me.HELP_URL_PRE & Me.myWorker.HelpFile) How do I get it to go away when the program exits? Now when I quit...
31
2143
by: louishong | last post by:
3rd time posting this as the first two simply disappeared! Here's the issue: We currently run an Access application in the West Coast for tracking resource centric data. For those located in the West the program zips along fine but the folks in the East Coast are having a nightmarish performance issue. We've had our tech guys take a look...
2
5399
by: Head In A Pan | last post by:
Hello! My JavaScripting is at novice level - and after completing a tutorial on a 'floating layer' I was proud that I got it working on Firefox, Safari, Camino & even IE5 for mac!!! But not IE7! The 'floating layer' does not float in IE7... it just sits up at the top of the screen - stuck in one place!! Explorer - why do you mock us?!!! ;( ...
1
1907
by: helraizer1 | last post by:
Hi folks, I have an image based shoutbox which I am currently implementing emoticons onto. I have a way now for the emoticons to appear where the :D or =) etc. is on the image, but for some reason they seem to be conflicting. I shall try to explain. chatbox.php - only necessary code shown $grins = array('=D', "=d", ":d", ":D"); ...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7756
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5326
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1879
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.