RE: [PHP-WIN] Re: Session Variables Problem (Missing)
| From: | HKG) | Date: | Tue, 13 Jan 2004 07:50:48 +0000 |
| Subject: | RE: [PHP-WIN] Re: Session Variables Problem (Missing) | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-22567@lists.php.net to get a copy of this message | ||
That's becasue it always create a new session.
Try (in psedo code):
IF NOT SESSION CREATED THEN
CREATE NEW SESSION
ELSE
DONT BOTHER TO CREATE NEW SESSION
END_IF
[CONTINUE DO YOUR STUFF]
-----Original Message-----
From: Brad Lawryk
To: php-windows@lists.php.net
Sent: 2004-01-12 22:00
Subject: [PHP-WIN] Re: Session Variables Problem (Missing)
Thanks Hubo,
When I make a page with that code ... it always says 'New Session'. No
matter what I do the 'Session Variable Saved' never shows up.
Brad
"Hubo" <hubo236@hotmail.com> wrote in message
news:btog97$28t$1@sea.gmane.org...
> The code shown below is a complete php script for you. Save these
lines
into
> a file, for example, 1.php, and try to visit it from a browser.
>
> "Brad Lawryk" <webmaster@wltimberwolves.com> schrieb im Newsbeitrag
> news:20040109232315.34408.qmail@pb1.pair.com...
> > Thanks Hubo,
> >
> > Where would I nsert that coding? The coding should be fine though as
the
> > page works flawlessly on a Linux Server?
> >
> > Brad
> >
> >
> > "Hubo" <hubo236@hotmail.com> wrote in message
> > news:btncrb$jdg$1@sea.gmane.org...
> > > To be sure that there is no coding error, just try this simple
code:
> > > '============ Begin ==============
> > > <?
> > > session_start();
> > > if (isset($_SESSION["test"])){
> > > echo $_SESSION["test"];
> > > }
> > > else {
> > > echo "new session";
> > > $_SESSION["test"]="session variable saved";
> > > }
> > > ?>
> > > '============== End ==============
> > > I have got no problem about the session variables on my W2K system
with
> > both
> > > IIS and Apache installed.
> > >
> > > By the way, since the php.ini is the same both for IIS and Apache,
both
> > > servers share the same session (and the session variables).
> > >
> > > "Brad Lawryk" <webmaster@wltimberwolves.com> schrieb im
Newsbeitrag
> > > news:20040109224429.80774.qmail@pb1.pair.com...
> > > > I am new to PHP moving over from ASP and one of things I relied
on
> > heavily
> > > > was session variables. It seems that everytime a new page is
opened
it
> > > > starts a new session.
> > > >
> > > > I have set up a simple test site you can see whats happening -
easier
> > than
> > > > to explain.
> > > >
> > > > http://www.cflsquad.com/index.php
> > > >
> > > > Use
> > > > Username: testuser
> > > > Password: testpassword
> > > >
> > > > the next page after log in should read "You are logged in as:
> testuser".
> > > > What tells me is that the session variable is resetting to a new
on
> each
> > > > page is that the 'testuder' text doesn't show becuase the
session
var
> is
> > > > being read. These exact same pages work fine oon a Linux server
so I
> > know
> > > > its a Windows Server issue. The odd thing is that the session ID
is
> > passed
> > > > and saved but the session variable that is created on log in is
not
> > > passed.
> > > > Again, it woks just fine on a Linux server - just not Windows.
> > > >
> > > > I have changed the path in the php.ini file as many have
suggested
> fixes
> > > the
> > > > problem but it hasn't made a difference for me.
> > > >
> > > > Thanks
> > > >
> > > > --
> > > > Brad Lawryk
> > > > Williams Lake TimberWolves
> > > > www.wltimberwolves.com
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit:
> > > > http://www.php.net/unsub.php
> > > >
> > > >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php