Re: [PHP] Closing Session (Revisited)

2011-05-23 Thread Pete Ford

On 22/05/11 06:46, Roger Riordan wrote:

On Thu, 05 May 2011 08:28:53 -0400, sstap...@mnsi.net (Steve Staples) wrote:


On Thu, 2011-05-05 at 21:41 +1000, Roger Riordan wrote:


I have developed a common engine which I use for several different websites. I 
had been
using PHP 5.2.? and IE6 (yes; I know!), and had been able to have multiple 
sessions open
at once, displaying the same or different websites, without them interfering 
with each
other. This was incredibly useful; I could be looking at, or even edit, 
different parts of
the same, or different, websites simultaneously without any problems.

But I recently had a hard disk crash and had to re-install all the system 
software. Now I
have PHP 5.3 and IE 8, and find that if I try to do this the various sessions 
interfere
with each other. From the above comment I gather that this is because IE 8 
combines all
the instances, whereas previously each instance was treated as a different user.

Is there any simple way to make IE 8 treat each instance as a new user, or 
should I switch
to Chrome and use the Incognito feature?

Roger Riordan AM
http://www.corybas.com/



The Incognito feature wont give you the results you're looking for.
> From my experience, the incognito window(s) and tab(s) share the same
memory/cookie/session space, which is different from the main window...
which means you will run into the same issue.

Once you close all your incognito windows/tabs, you will release those
cookies/sessions/memory space and if you open a new one afterwards, then
you will be fine, but if one tabs stays open, no go :(

Have you looked at the http://ca3.php.net/session_name function, and
putting that into your site just after your session_start() ?  I believe
that will fix your issues (as long as your session names are unique),
but i am not 100% sure.

Steve



Thank you for this suggestion. This has solved the more serious half of my 
problems; I can
easily generate a different session name for each website, so that the various 
websites
don't interfere with each other, but I have not been able to devise a way to 
differentiate
between multiple sessions of the same website.

For example, if I open one copy of a website as a visitor I am shown as 
Visitor, but if I
then open another window, and log in as Manager, then go back to the first 
window I am
shown as Manager (with appropriate privileges) there also.

The only way I can think of to overcome this would be to generate a new named 
session
every time I log in, and then to pass the session name as a parameter every 
time I load a
new page. Unfortunately my program is sufficiently complicated that this is 
effectively
impractical, as it would involve tracking down and modifying every point in the 
program at
which a new page can be launched.

It also has a theoretical disadvantage that if someone bookmarks a page they 
will book
mark the session name, but this can fairly readily be overcome.

Is there any alternative way in which a different session name (or equivalent 
flag) can be
attached to each instance of the browser?

(Effectively these problems only affect the developer, as they only apply to 
multiple
instances of the same browser on the same PC.)


PS. At this stage I devised a really nasty kludge, which enables me to run 
multiple copies
without them interfering. In my program new pages are always launched by a 
command of the
general type:

http://localhost/cypalda.com/index.php?level=1&item=22

This loads the file index.php, which is a very brief file in the public 
directory
(cypalda.com in this case). It sets a couple of constants and then transfers 
control to a
file Begin.php, in a private directory. This in turn sets up a whole lot more 
constants,
and then transfers control to the main program, which is common to 5 different 
websites.

I realised that if I specify the session name in index.php, I can make several 
copies of
this file, e.g. index.php, index1.php, index2.php, each of which specified a 
different
session name. I thought this still left me the problem of modifying all the 
points at
which a new page was launched, but then I found that by great good fortune (or 
foresight!)
I had defined a constant $home_page = index.php, and always launched a new page 
with the
basic command
echo ('http://www.corybas.com/


Depending upon how your session persistence works, can you not just specify a 
different location to store session data for each possible mode of login?
I have an application which does something similar, and uses a simple file store 
for the session data, so I have 'Manager' session data stored in 
/tmp/Manager/...  and 'User' session data stored in /tmp/User/...  (for example).
It does rather depend on your Manager and User applications not expecting to 
cross over: that is, a Manager can't switch to User mode in the same session.



--
Peter Ford, Developer phone: 01580 89 fax: 01580 893399
Justcroft International Ltd.  

Re: [PHP] Closing Session (Revisited)

2011-05-21 Thread Roger Riordan
On Thu, 05 May 2011 08:28:53 -0400, sstap...@mnsi.net (Steve Staples) wrote:

>On Thu, 2011-05-05 at 21:41 +1000, Roger Riordan wrote:
>> 
>> I have developed a common engine which I use for several different websites. 
>> I had been
>> using PHP 5.2.? and IE6 (yes; I know!), and had been able to have multiple 
>> sessions open
>> at once, displaying the same or different websites, without them interfering 
>> with each
>> other. This was incredibly useful; I could be looking at, or even edit, 
>> different parts of
>> the same, or different, websites simultaneously without any problems.
>> 
>> But I recently had a hard disk crash and had to re-install all the system 
>> software. Now I
>> have PHP 5.3 and IE 8, and find that if I try to do this the various 
>> sessions interfere
>> with each other. From the above comment I gather that this is because IE 8 
>> combines all
>> the instances, whereas previously each instance was treated as a different 
>> user.
>> 
>> Is there any simple way to make IE 8 treat each instance as a new user, or 
>> should I switch
>> to Chrome and use the Incognito feature?
>> 
>> Roger Riordan AM
>> http://www.corybas.com/
>> 
>
>The Incognito feature wont give you the results you're looking for.
>>From my experience, the incognito window(s) and tab(s) share the same
>memory/cookie/session space, which is different from the main window...
>which means you will run into the same issue.
>
>Once you close all your incognito windows/tabs, you will release those
>cookies/sessions/memory space and if you open a new one afterwards, then
>you will be fine, but if one tabs stays open, no go :(
>
>Have you looked at the http://ca3.php.net/session_name function, and
>putting that into your site just after your session_start() ?  I believe
>that will fix your issues (as long as your session names are unique),
>but i am not 100% sure.
>
>Steve
>

Thank you for this suggestion. This has solved the more serious half of my 
problems; I can
easily generate a different session name for each website, so that the various 
websites
don't interfere with each other, but I have not been able to devise a way to 
differentiate
between multiple sessions of the same website.

For example, if I open one copy of a website as a visitor I am shown as 
Visitor, but if I
then open another window, and log in as Manager, then go back to the first 
window I am
shown as Manager (with appropriate privileges) there also.

The only way I can think of to overcome this would be to generate a new named 
session
every time I log in, and then to pass the session name as a parameter every 
time I load a
new page. Unfortunately my program is sufficiently complicated that this is 
effectively
impractical, as it would involve tracking down and modifying every point in the 
program at
which a new page can be launched.

It also has a theoretical disadvantage that if someone bookmarks a page they 
will book
mark the session name, but this can fairly readily be overcome.

Is there any alternative way in which a different session name (or equivalent 
flag) can be
attached to each instance of the browser?

(Effectively these problems only affect the developer, as they only apply to 
multiple
instances of the same browser on the same PC.)


PS. At this stage I devised a really nasty kludge, which enables me to run 
multiple copies
without them interfering. In my program new pages are always launched by a 
command of the
general type:

http://localhost/cypalda.com/index.php?level=1&item=22

This loads the file index.php, which is a very brief file in the public 
directory
(cypalda.com in this case). It sets a couple of constants and then transfers 
control to a
file Begin.php, in a private directory. This in turn sets up a whole lot more 
constants,
and then transfers control to the main program, which is common to 5 different 
websites.

I realised that if I specify the session name in index.php, I can make several 
copies of
this file, e.g. index.php, index1.php, index2.php, each of which specified a 
different
session name. I thought this still left me the problem of modifying all the 
points at
which a new page was launched, but then I found that by great good fortune (or 
foresight!)
I had defined a constant $home_page = index.php, and always launched a new page 
with the
basic command
echo ('http://www.corybas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session (Revisited)

2011-05-05 Thread Steve Staples
On Thu, 2011-05-05 at 21:41 +1000, Roger Riordan wrote:
> On Thu, 31 Mar 2011 16:40:06 -0400, eth...@earthlink.net (Ethan Rosenberg) 
> wrote:
> ...
> >> > > Can you rephrase the question, Ethan, or give more details?  From
> >> > >the way it sounds, you're concerned that destroying a session will
> >> > >have implications for other sessions as well, which is not the case
> >> > >(unless all sessions are shared).  For example, if you have Chrome,
> >> > >Firefox, and Internet Exploder all active, the sessions should be
> >> > >different, if even from the very same computer.  However, multiple
> >> > >tabs in the same browser will generally be the same session (unless
> >> > >it's something like Chrome's Incognito feature).
> ...
> 
> I have developed a common engine which I use for several different websites. 
> I had been
> using PHP 5.2.? and IE6 (yes; I know!), and had been able to have multiple 
> sessions open
> at once, displaying the same or different websites, without them interfering 
> with each
> other. This was incredibly useful; I could be looking at, or even edit, 
> different parts of
> the same, or different, websites simultaneously without any problems.
> 
> But I recently had a hard disk crash and had to re-install all the system 
> software. Now I
> have PHP 5.3 and IE 8, and find that if I try to do this the various sessions 
> interfere
> with each other. From the above comment I gather that this is because IE 8 
> combines all
> the instances, whereas previously each instance was treated as a different 
> user.
> 
> Is there any simple way to make IE 8 treat each instance as a new user, or 
> should I switch
> to Chrome and use the Incognito feature?
> 
> Roger Riordan AM
> http://www.corybas.com/
> 

The Incognito feature wont give you the results you're looking for.
>From my experience, the incognito window(s) and tab(s) share the same
memory/cookie/session space, which is different from the main window...
which means you will run into the same issue.

Once you close all your incognito windows/tabs, you will release those
cookies/sessions/memory space and if you open a new one afterwards, then
you will be fine, but if one tabs stays open, no go :(

Have you looked at the http://ca3.php.net/session_name function, and
putting that into your site just after your session_start() ?  I believe
that will fix your issues (as long as your session names are unique),
but i am not 100% sure.

Steve



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session (Revisited)

2011-05-05 Thread Roger Riordan
On Thu, 31 Mar 2011 16:40:06 -0400, eth...@earthlink.net (Ethan Rosenberg) 
wrote:
...
>> > > Can you rephrase the question, Ethan, or give more details?  From
>> > >the way it sounds, you're concerned that destroying a session will
>> > >have implications for other sessions as well, which is not the case
>> > >(unless all sessions are shared).  For example, if you have Chrome,
>> > >Firefox, and Internet Exploder all active, the sessions should be
>> > >different, if even from the very same computer.  However, multiple
>> > >tabs in the same browser will generally be the same session (unless
>> > >it's something like Chrome's Incognito feature).
...

I have developed a common engine which I use for several different websites. I 
had been
using PHP 5.2.? and IE6 (yes; I know!), and had been able to have multiple 
sessions open
at once, displaying the same or different websites, without them interfering 
with each
other. This was incredibly useful; I could be looking at, or even edit, 
different parts of
the same, or different, websites simultaneously without any problems.

But I recently had a hard disk crash and had to re-install all the system 
software. Now I
have PHP 5.3 and IE 8, and find that if I try to do this the various sessions 
interfere
with each other. From the above comment I gather that this is because IE 8 
combines all
the instances, whereas previously each instance was treated as a different user.

Is there any simple way to make IE 8 treat each instance as a new user, or 
should I switch
to Chrome and use the Incognito feature?

Roger Riordan AM
http://www.corybas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session - Apache

2011-04-01 Thread Ethan Rosenberg

At 05:04 AM 4/1/2011, Richard Quadling wrote:

On 31 March 2011 23:16, Ethan Rosenberg  wrote:
>
>>> 
> Dan -
>
> I'm a newbie...
>
> 1] What should the line in the Apache configuration file be? Just to be
> sure, the file is: /etc/apache2/apache2.conf, correct?


--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY


Thanks.

To set up subdomains w/ Apache..
127.0.0.1 localhost development subdomain.development

 Don't worry about it being an FQDN.  Prior to checking with the
 router or DNS servers, all modern systems check the hosts file.  Then
 just add a reference to each in your Apache configuration file and
 restart Apache.  Boom.  Done

Can someone help w/ this:

What should the line in the Apache configuration file be? Just to be
sure, the file is: /etc/apache2/apache2.conf, correct?

Ethan 




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Closing Session

2011-04-01 Thread Ford, Mike
> -Original Message-
> From: Ethan Rosenberg [mailto:eth...@earthlink.net]
> Sent: 31 March 2011 21:40
 
> I can be working on more than one program simultaneously and have
> one
> tab open w/ program A and another w/ program B.  The site in
> reference is "http://localhost";

Do these programs share any part of their session information? If not,
then how about using session_name() to differentiate - that way, each
one stores its session_id in its own cookie and will have its own
session.

On the other hand, if they do share parts of the session information
(such as user id, say), the suggestion of using sub-arrays per
application sounds good to me.

Cheers!

Mike
 -- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Leeds Metropolitan University, C507 City Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
Email: m.f...@leedsmet.ac.uk 
Tel: +44 113 812 4730




To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-04-01 Thread Richard Quadling
On 31 March 2011 23:16, Ethan Rosenberg  wrote:
>
>>> 
>>>        127.0.0.1 localhost development subdomain.development
>>>
>>>    Don't worry about it being an FQDN.  Prior to checking with the
>>> router or DNS servers, all modern systems check the hosts file.  Then
>>> just add a reference to each in your Apache configuration file and
>>> restart Apache.  Boom.  Done.
>>>
>>> --
>>> 
>>> Network Infrastructure Manager
>>> http://www.php.net/
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>> =
>
> Dan -
>
> I'm a newbie...
>
> 1] What should the line in the Apache configuration file be? Just to be
> sure, the file is: /etc/apache2/apache2.conf, correct?

I don't use Apache, so hopefully someone else can answer this.

> 2] Back to the original questionhow do I kill a session from the
> terminal?

You can't.

But if you can find the session ID, you could manually delete the
session file - if you are using files for your sessions.

If you are using a DB, then you'd have to write a script to kill it.

Another option would be to create a killsession.php script ...



I think that'll do the job.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-04-01 Thread Richard Quadling
On 31 March 2011 21:40, Ethan Rosenberg  wrote:
> At 02:12 PM 3/31/2011, Ashley Sheridan wrote:
>>
>> On Thu, 2011-03-31 at 13:54 -0400, Ethan Rosenberg wrote:
>>
>> > At 01:30 PM 3/31/2011, Daniel Brown wrote:
>> > >On Thu, Mar 31, 2011 at 13:09, Ethan Rosenberg 
>> > > wrote:
>> > > > Dear List -
>> > > >
>> > > > Thanks for your help.
>> > > >
>> > > > How do I close a session form the terminal?  I need the ability to
>> > > > do this
>> > > > for debugging.  I often have more than one session open at the
>> > > same time, so
>> > > > creating a program with session_start() and session_unset() or
>> > > > session_destoy() would probably not work.
>> > >
>> > >     Can you rephrase the question, Ethan, or give more details?  From
>> > >the way it sounds, you're concerned that destroying a session will
>> > >have implications for other sessions as well, which is not the case
>> > >(unless all sessions are shared).  For example, if you have Chrome,
>> > >Firefox, and Internet Exploder all active, the sessions should be
>> > >different, if even from the very same computer.  However, multiple
>> > >tabs in the same browser will generally be the same session (unless
>> > >it's something like Chrome's Incognito feature).
>> > >
>> > >--
>> > >
>> > >Network Infrastructure Manager
>> > >http://www.php.net/
>> > =
>> > Thanks.
>> >
>> > >Multiple tabs in the same browser will generally be the same session.
>> >
>> > That is what I have.
>> >
>> > Ethan
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>> If they're all in the same browser, then what distinguishes them from
>> one another? If you could use that and add some sort of array in the
>> session with entries bearing to what tabs you have open then you could
>> use that to 'close' sessions. Why do you need multiple tabs open to the
>> same site anyway, maybe if you explained what it is you're trying to
>> achieve, we might help with a better way?
>>
>> --
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>
> 
> Ash -
>
> I can be working on more than one program simultaneously and have one tab
> open w/ program A and another w/ program B.  The site in reference is
> "http://localhost";
>
> I hope this helps.
>
> Ethan
>
>
> MySQL 5.1  PHP 5.3.3-6  Linux [Debian (sid)]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

You can use a path element in the session cookie ...

session_cookie(60, '/appA', 'localhost'); // For http://localhost/appA
session_cookie(60, '/appB', 'localhost'); // For http://localhost/appB

maybe.

I don't use localhost.

Instead, I create vhosts on the web server and use DNS (or you can use
entries in your HOSTs file).

That way I can have separate sites, each with their own domain name
and allow for multiple sub-domains (dev, test and www for live).


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Ethan Rosenberg




127.0.0.1 localhost development subdomain.development

Don't worry about it being an FQDN.  Prior to checking with the
router or DNS servers, all modern systems check the hosts file.  Then
just add a reference to each in your Apache configuration file and
restart Apache.  Boom.  Done.

--

Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

=


Dan -

I'm a newbie...

1] What should the line in the Apache configuration file be? Just to 
be sure, the file is: /etc/apache2/apache2.conf, correct?


2] Back to the original questionhow do I kill a session from the terminal?

Thanks.

Ethan



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Ethan Rosenberg

At 05:37 PM 3/31/2011, Ethan Rosenberg wrote:

At 04:51 PM 3/31/2011, Daniel Brown wrote:

On Thu, Mar 31, 2011 at 16:40, Ethan Rosenberg  wrote:
>
> 
> Ash -
>
> I can be working on more than one program simultaneously and have one tab
> open w/ program A and another w/ program B.  The site in reference is
> "http://localhost";
>
> I hope this helps.

Ah, but running on the same domain, the session will be common.
Right.  Killing a session will kill it in both programs, as you
already know, but there's no native way to do one for one
[file|directory].  Your best bet, if at all possible, is to separate
by subdomains (which you can do on localhost, too, by modifying your
hosts file to alias like so:

127.0.0.1 localhost development subdomain.development

Don't worry about it being an FQDN.  Prior to checking with the
router or DNS servers, all modern systems check the hosts file.  Then
just add a reference to each in your Apache configuration file and
restart Apache.  Boom.  Done.

--

Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

=


Dan -

Thanks.

Two questions:

1] What is the URL for the sub domain?

2] How do kill a session from the command line?

Ethan



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Stuart Dallas
On Thursday, 31 March 2011 at 21:53, Ashley Sheridan wrote:
On Thu, 2011-03-31 at 16:40 -0400, Ethan Rosenberg wrote:
> 
> > At 02:12 PM 3/31/2011, Ashley Sheridan wrote:
> > > On Thu, 2011-03-31 at 13:54 -0400, Ethan Rosenberg wrote:
> > > 
> > > > At 01:30 PM 3/31/2011, Daniel Brown wrote:
> > > > > On Thu, Mar 31, 2011 at 13:09, Ethan Rosenberg 
> > >  wrote:
> > > > > > Dear List -
> > > > > > 
> > > > > > Thanks for your help.
> > > > > > 
> > > > > > How do I close a session form the terminal? I need the 
> > > ability to do this
> > > > > > for debugging. I often have more than one session open at the
> > > > > same time, so
> > > > > > creating a program with session_start() and session_unset() or
> > > > > > session_destoy() would probably not work.
> > > > > 
> > > > >  Can you rephrase the question, Ethan, or give more details? From
> > > > > the way it sounds, you're concerned that destroying a session will
> > > > > have implications for other sessions as well, which is not the case
> > > > > (unless all sessions are shared). For example, if you have Chrome,
> > > > > Firefox, and Internet Exploder all active, the sessions should be
> > > > > different, if even from the very same computer. However, multiple
> > > > > tabs in the same browser will generally be the same session (unless
> > > > > it's something like Chrome's Incognito feature).
> > > > > 
> > > > > --
> > > > > 
> > > > > Network Infrastructure Manager
> > > > > http://www.php.net/
> > > > =
> > > > Thanks.
> > > > 
> > > > > Multiple tabs in the same browser will generally be the same session.
> > > > 
> > > > That is what I have.
> > > > 
> > > > Ethan
> > > > 
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > 
> > > 
> > > If they're all in the same browser, then what distinguishes them from
> > > one another? If you could use that and add some sort of array in the
> > > session with entries bearing to what tabs you have open then you could
> > > use that to 'close' sessions. Why do you need multiple tabs open to the
> > > same site anyway, maybe if you explained what it is you're trying to
> > > achieve, we might help with a better way?
> > > 
> > > --
> > > Thanks,
> > > Ash
> > > http://www.ashleysheridan.co.uk
> > 
> > 
> > Ash -
> > 
> > I can be working on more than one program simultaneously and have one 
> > tab open w/ program A and another w/ program B. The site in 
> > reference is "http://localhost";
> > 
> > I hope this helps.
> > 
> > Ethan
> > 
> > 
> > MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)] 
> 
> 
> I had this problem quite a lot, so now I use sub-arrays for each site.
> For example:
> 
> $_SESSION['personal_website'] = session data;
> $_SESSION['friends_site'] = session data;
> $_SESSION['shop_down_the_road'] = session data;
> 
> Then you need only unset the specific array for that site, rather than
> the whole session.

Another option is to use http://php.net/session-set-cookie-params to set the 
path for which the session cookie is valid.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Steve Staples
On Thu, 2011-03-31 at 16:51 -0400, Daniel Brown wrote:
> On Thu, Mar 31, 2011 at 16:40, Ethan Rosenberg  wrote:
> >
> > 
> > Ash -
> >
> > I can be working on more than one program simultaneously and have one tab
> > open w/ program A and another w/ program B.  The site in reference is
> > "http://localhost";
> >
> > I hope this helps.
> 
> Ah, but running on the same domain, the session will be common.
> Right.  Killing a session will kill it in both programs, as you
> already know, but there's no native way to do one for one
> [file|directory].  Your best bet, if at all possible, is to separate
> by subdomains (which you can do on localhost, too, by modifying your
> hosts file to alias like so:
> 
> 127.0.0.1 localhost development subdomain.development
> 
> Don't worry about it being an FQDN.  Prior to checking with the
> router or DNS servers, all modern systems check the hosts file.  Then
> just add a reference to each in your Apache configuration file and
> restart Apache.  Boom.  Done.
> 
> -- 
> 
> Network Infrastructure Manager
> http://www.php.net/
> 

Can you not "NAME" the sessions?  and kill/destory the named session?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Ashley Sheridan
On Thu, 2011-03-31 at 16:40 -0400, Ethan Rosenberg wrote:

> At 02:12 PM 3/31/2011, Ashley Sheridan wrote:
> >On Thu, 2011-03-31 at 13:54 -0400, Ethan Rosenberg wrote:
> >
> > > At 01:30 PM 3/31/2011, Daniel Brown wrote:
> > > >On Thu, Mar 31, 2011 at 13:09, Ethan Rosenberg 
> >  wrote:
> > > > > Dear List -
> > > > >
> > > > > Thanks for your help.
> > > > >
> > > > > How do I close a session form the terminal?  I need the 
> > ability to do this
> > > > > for debugging.  I often have more than one session open at the
> > > > same time, so
> > > > > creating a program with session_start() and session_unset() or
> > > > > session_destoy() would probably not work.
> > > >
> > > > Can you rephrase the question, Ethan, or give more details?  From
> > > >the way it sounds, you're concerned that destroying a session will
> > > >have implications for other sessions as well, which is not the case
> > > >(unless all sessions are shared).  For example, if you have Chrome,
> > > >Firefox, and Internet Exploder all active, the sessions should be
> > > >different, if even from the very same computer.  However, multiple
> > > >tabs in the same browser will generally be the same session (unless
> > > >it's something like Chrome's Incognito feature).
> > > >
> > > >--
> > > >
> > > >Network Infrastructure Manager
> > > >http://www.php.net/
> > > =
> > > Thanks.
> > >
> > > >Multiple tabs in the same browser will generally be the same session.
> > >
> > > That is what I have.
> > >
> > > Ethan
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >If they're all in the same browser, then what distinguishes them from
> >one another? If you could use that and add some sort of array in the
> >session with entries bearing to what tabs you have open then you could
> >use that to 'close' sessions. Why do you need multiple tabs open to the
> >same site anyway, maybe if you explained what it is you're trying to
> >achieve, we might help with a better way?
> >
> >--
> >Thanks,
> >Ash
> >http://www.ashleysheridan.co.uk
> 
> 
> Ash -
> 
> I can be working on more than one program simultaneously and have one 
> tab open w/ program A and another w/ program B.  The site in 
> reference is "http://localhost";
> 
> I hope this helps.
> 
> Ethan
> 
> 
> MySQL 5.1  PHP 5.3.3-6  Linux [Debian (sid)] 
> 
> 
> 


I had this problem quite a lot, so now I use sub-arrays for each site.
For example:

$_SESSION['personal_website'] = session data;
$_SESSION['friends_site'] = session data;
$_SESSION['shop_down_the_road'] = session data;

Then you need only unset the specific array for that site, rather than
the whole session.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Closing Session

2011-03-31 Thread Daniel Brown
On Thu, Mar 31, 2011 at 16:40, Ethan Rosenberg  wrote:
>
> 
> Ash -
>
> I can be working on more than one program simultaneously and have one tab
> open w/ program A and another w/ program B.  The site in reference is
> "http://localhost";
>
> I hope this helps.

Ah, but running on the same domain, the session will be common.
Right.  Killing a session will kill it in both programs, as you
already know, but there's no native way to do one for one
[file|directory].  Your best bet, if at all possible, is to separate
by subdomains (which you can do on localhost, too, by modifying your
hosts file to alias like so:

127.0.0.1 localhost development subdomain.development

Don't worry about it being an FQDN.  Prior to checking with the
router or DNS servers, all modern systems check the hosts file.  Then
just add a reference to each in your Apache configuration file and
restart Apache.  Boom.  Done.

-- 

Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Ethan Rosenberg

At 02:12 PM 3/31/2011, Ashley Sheridan wrote:

On Thu, 2011-03-31 at 13:54 -0400, Ethan Rosenberg wrote:

> At 01:30 PM 3/31/2011, Daniel Brown wrote:
> >On Thu, Mar 31, 2011 at 13:09, Ethan Rosenberg 
 wrote:

> > > Dear List -
> > >
> > > Thanks for your help.
> > >
> > > How do I close a session form the terminal?  I need the 
ability to do this

> > > for debugging.  I often have more than one session open at the
> > same time, so
> > > creating a program with session_start() and session_unset() or
> > > session_destoy() would probably not work.
> >
> > Can you rephrase the question, Ethan, or give more details?  From
> >the way it sounds, you're concerned that destroying a session will
> >have implications for other sessions as well, which is not the case
> >(unless all sessions are shared).  For example, if you have Chrome,
> >Firefox, and Internet Exploder all active, the sessions should be
> >different, if even from the very same computer.  However, multiple
> >tabs in the same browser will generally be the same session (unless
> >it's something like Chrome's Incognito feature).
> >
> >--
> >
> >Network Infrastructure Manager
> >http://www.php.net/
> =
> Thanks.
>
> >Multiple tabs in the same browser will generally be the same session.
>
> That is what I have.
>
> Ethan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


If they're all in the same browser, then what distinguishes them from
one another? If you could use that and add some sort of array in the
session with entries bearing to what tabs you have open then you could
use that to 'close' sessions. Why do you need multiple tabs open to the
same site anyway, maybe if you explained what it is you're trying to
achieve, we might help with a better way?

--
Thanks,
Ash
http://www.ashleysheridan.co.uk



Ash -

I can be working on more than one program simultaneously and have one 
tab open w/ program A and another w/ program B.  The site in 
reference is "http://localhost";


I hope this helps.

Ethan


MySQL 5.1  PHP 5.3.3-6  Linux [Debian (sid)] 




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Daniel Brown
On Thu, Mar 31, 2011 at 13:54, Ethan Rosenberg  wrote:
>
> That is what I have.

So now the guessing game begins, I suppose, right?

What happened to rephrasing the original question, Ethan?  ;-P

(And why did you send me a link to your copy of WinZip?)

-- 

Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Closing Session

2011-03-31 Thread Ashley Sheridan
On Thu, 2011-03-31 at 13:54 -0400, Ethan Rosenberg wrote:

> At 01:30 PM 3/31/2011, Daniel Brown wrote:
> >On Thu, Mar 31, 2011 at 13:09, Ethan Rosenberg  wrote:
> > > Dear List -
> > >
> > > Thanks for your help.
> > >
> > > How do I close a session form the terminal?  I need the ability to do this
> > > for debugging.  I often have more than one session open at the 
> > same time, so
> > > creating a program with session_start() and session_unset() or
> > > session_destoy() would probably not work.
> >
> > Can you rephrase the question, Ethan, or give more details?  From
> >the way it sounds, you're concerned that destroying a session will
> >have implications for other sessions as well, which is not the case
> >(unless all sessions are shared).  For example, if you have Chrome,
> >Firefox, and Internet Exploder all active, the sessions should be
> >different, if even from the very same computer.  However, multiple
> >tabs in the same browser will generally be the same session (unless
> >it's something like Chrome's Incognito feature).
> >
> >--
> >
> >Network Infrastructure Manager
> >http://www.php.net/
> =
> Thanks.
> 
> >Multiple tabs in the same browser will generally be the same session.
> 
> That is what I have.
> 
> Ethan
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


If they're all in the same browser, then what distinguishes them from
one another? If you could use that and add some sort of array in the
session with entries bearing to what tabs you have open then you could
use that to 'close' sessions. Why do you need multiple tabs open to the
same site anyway, maybe if you explained what it is you're trying to
achieve, we might help with a better way?

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Closing Session

2011-03-31 Thread Ethan Rosenberg

At 01:30 PM 3/31/2011, Daniel Brown wrote:

On Thu, Mar 31, 2011 at 13:09, Ethan Rosenberg  wrote:
> Dear List -
>
> Thanks for your help.
>
> How do I close a session form the terminal?  I need the ability to do this
> for debugging.  I often have more than one session open at the 
same time, so

> creating a program with session_start() and session_unset() or
> session_destoy() would probably not work.

Can you rephrase the question, Ethan, or give more details?  From
the way it sounds, you're concerned that destroying a session will
have implications for other sessions as well, which is not the case
(unless all sessions are shared).  For example, if you have Chrome,
Firefox, and Internet Exploder all active, the sessions should be
different, if even from the very same computer.  However, multiple
tabs in the same browser will generally be the same session (unless
it's something like Chrome's Incognito feature).

--

Network Infrastructure Manager
http://www.php.net/

=
Thanks.


Multiple tabs in the same browser will generally be the same session.


That is what I have.

Ethan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Closing Session

2011-03-31 Thread Daniel Brown
On Thu, Mar 31, 2011 at 13:09, Ethan Rosenberg  wrote:
> Dear List -
>
> Thanks for your help.
>
> How do I close a session form the terminal?  I need the ability to do this
> for debugging.  I often have more than one session open at the same time, so
> creating a program with session_start() and session_unset() or
> session_destoy() would probably not work.

Can you rephrase the question, Ethan, or give more details?  From
the way it sounds, you're concerned that destroying a session will
have implications for other sessions as well, which is not the case
(unless all sessions are shared).  For example, if you have Chrome,
Firefox, and Internet Exploder all active, the sessions should be
different, if even from the very same computer.  However, multiple
tabs in the same browser will generally be the same session (unless
it's something like Chrome's Incognito feature).

-- 

Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Closing Session

2011-03-31 Thread Jay Blanchard
[snip]How do I close a session form the terminal?[/snip]

http://php.net/manual/en/function.session-destroy.php
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Closing Session

2011-03-31 Thread Ethan Rosenberg

Dear List -

Thanks for your help.

How do I close a session form the terminal?  I need the ability to do 
this for debugging.  I often have more than one session open at the 
same time, so creating a program with session_start() and 
session_unset() or session_destoy() would probably not work.


Ethan 




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php