When reg_globals is off, you can't access session vars just with $varA and
$varB (thess variables are not set), you need to use
$HTTP_SESSION_VARS['varA'] and $HTTP_SESSION_VARS['varB'] to access these
variables !!
-Message d'origine-
De : ahmad varoqua [mailto:[EMAIL PROTECTED]]
Envoyé :
The SID will only be added automatically if -enable-trans-sid is set and
your browser has cookies switched off. When cookies are on the session id
is propagated using a cookie. So likewise the constant will only
be expanded when cookies are switched off.
Anyway, yes you will have to add to al
Nope, you can use header() after starting a session.
This works fine, even if a session is already started:
session_start();
header("Location: http://www.fbi.gov");
Creapy, but it works.
You see, when a "header" is sent, it's not actually "sent". PHP collects all
headers and fills out a head
ginal Message-
From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 12:20 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] SESSIONS, a weird, funny yet strange error happens to
wrong people...
I was curious about your post, so I take a look at the module source.
It seems you
On Thursday 19 April 2001 13:52, you wrote:
> > What to fix?
>
> Her ;)
>
>
> Seriously though, is it possible that she stopped browsing the site
> long enough for the session to expire and be cleaned up by the garbage
> handler, then she continued on the page with a PHPSESSID that no longer
> exi
I was curious about your post, so I take a look at the module source.
It seems you could be right if O_EXCL is not defined when PHP is compiled. If
O_EXCL is defined, it creates if there is no session data file.
--
Yasuo Ohgaki
""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9bmjl2$rc4$[EMAIL
> What to fix?
Her ;)
Seriously though, is it possible that she stopped browsing the site long
enough for the session to expire and be cleaned up by the garbage handler,
then she continued on the page with a PHPSESSID that no longer existed?
In that case the error would occur only once, as a
Does she use multiple browsers for your site? I think she is doing this.
I'm not sure if session "files" handler is using flock() or not. It could be
failing to open file, since file is locked. (I think it should lock file, since
it's possible to get length 0 file w/o it) This problem will not oc
Rather than bothering with SID whos existance is uncertain, use the variable
$PHPSESSID. It's set whenever you use session_start, to my knowledge.
The simplest method, and the only one I am aware of, of accessing session
variables globally is by explicitly declaring them global in your function.
HI
Opers has a nasty caching behaviour which can cause problems with sessions
and having different entry points on the same index page. To overcome some
of the problems any hrefs that don't contain get variables should be set
up as:
Even if you never use the variable "entered" it will s
Ahh. I reread your post and now I see what you were originally asking.
Yes, sessions are the best way to handle it then. The variables "live" by
sending a specially augmented header to the client. The header sort of
"sticks" to the client so that their session ID is automatically sent in
their r
Plutarck wrote:
> The way I do it is to stick all those global variables into an include file,
> which I usually named something like global.php.
Um no. These aren't static variables. They change from page to
page. For example, page one
$foo=0, $bar=3, $baz='Closed'
They follow a partic
The way I do it is to stick all those global variables into an include file,
which I usually named something like global.php.
Just do that and require() the file at the top of all your scripts which
need it. Keep things like page color, text color, font, etc in the global
file.
If you ever need
I don't recommend putting the Session ID in the URL. Subscibed members could
pass URL's to eachother and that way they could have eachother's settings.
""David Hynes"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am using sessions to password protect a sec
I had this same problem and it constantly broke our whole site.
So I tried a different approach and this has been working great:
Instead of
Consider:
It works flawlessly, always, and maintains your session.
Because my site ( a shopping cart/store ) is so dependent on sessions, I
stopped us
Hi Andrew,
I`m not sure if switching from http to https will count as a *new* domain,
but here is a link to some information which may solve your problem.
http://phpbuilder.com/columns/chriskings20001128.php3
HTH
Ade
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail:
I don't know 100& for sure, but I believe since it is going to an https
link, it considers it a new domain(or something) and that's why the sessions
aren't persisting. The same thing happens if you redirect from say
www.domain.com to www2.domain.com. I odn't know any way around it, except
encodi
PHP will do this for you. See the setting "session.gc_maxlifetime" in the
php.ini file. This sets the session lifetime.
Kirk
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 29, 2001 10:37 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Sessio
Well, try this:
$REMOTE_USER
or
$PHP_AUTH_USER
or
$HTTP_SERVER_VARS["REMOTE_USER"]
or
$HTTP_SERVER_VARS["PHP_AUTH_USER"]
or
$HTTP_SERVER_VARS{"PHP_AUTH_USER"}
or
$HTTP_SERVER_VARS{"REMOTE_USER"}
...make your choice...
RenzE
Rahul Bhide wrote:
>
Why do you use un/serialize() for array?
If you are using PHP4 session, you don't need it. It's done in session module.
Multiple serialize() may be causing your problem.
--
Yasuo Ohgaki
"Christian Dechery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I tri
Since you are using PHP4.0.4pl1, you also should be able to access session vars
with $HTTP_SESSION_VARS.
Dose it make differences?
--
Yasuo Ohgaki
"Shane Iseminger" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hello all,
>
> Of course, apologies if this
PM
To: PHPBeginner.com; Php-General
Subject: Re: [PHP] Sessions to password protect directory?
Will this be able to protect the images in the directory? For example, if
someone tries to access an image in the directory, will the "auth.php" be
executed?
Thanks for everything.
- Kyutums
&
Will this be able to protect the images in the directory? For example, if
someone tries to access an image in the directory, will the "auth.php" be
executed?
Thanks for everything.
- Kyutums
"PHPBeginner.com" wrote:
> All you need is to add this into .htaccess
>
> php_value auto_prepend auth.p
You can use URL mode for PHP4 session if you want session w/o cookie.
How about read this link?
http://www.zend.com/zend/tut/session.php
--
Yasuo Ohgaki
"duirfire" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi, can someone point me toward a tutorial tha
All you need is to add this into .htaccess
php_value auto_prepend auth.php
when any file under that directory is being accessed, auth.php will come on
top, there - make your own script to pass-protect yourself..
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PH
Few of us have time to play with your script, but
if you refer to the fact that the form you submitted and once new page came
up - you clicked back seeing nothing, that is something that happens most of
the time.
As Sascha once explained that to me - that is the way Sessions work.
well, if that
attachments ar stripped for security purposes by the mailing list server. please post
the code in your msg.
--
Chris Lee
[EMAIL PROTECTED]
""Miguel Loureiro"" <[EMAIL PROTECTED]> wrote in message
00ad01c0b2ff$f12a9c00$[EMAIL PROTECTED]">news:00ad01c0b2ff$f12a9c00$[EMAIL PROTECTED]...
Hel
Apologies for the long post.
I use this approach: (simplified) at the top of every page,
before any HTML. Pop it into an include right at the top.
I have not included all the util function e.g. LogQuietAlert()
regards
Jeff
");
gotoPage("/login");
}
}
#===
[EMAIL PROTECTED] [[EMAIL PROTECTED]] wrote:
> Hi,
>
> I am going to use sessions to authenticate and protect my pages, this is what
> I have so far...
>
> User logs in via form, this is checked via a SQL call, if the correct
> username and password are entered I run the following:
>
> sessio
i ve no problem with arrays?
just cant register them into sessions.
""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Although, you ask not to refer to PHP manual, there is a function you
probably
> would like to learn.
> (I guess you haven't r
Although, you ask not to refer to PHP manual, there is a function you probably
would like to learn.
(I guess you haven't read about array functions, right?)
http://www.php.net/manual/en/function.array-merge.php
This should be what you are looking for.
(Don't over write, but merge arrays. I guess
Eric, I gotta ask the obvious question: did you have cookies disabled in
your browser when you were checking this out? PHPSESSID only gets appended
when cookies are disabled. If that is not the problem, I have no
suggestions. Works for me as advertised.
Kirk
> -Original Message-
> From:
It looks it would not cause too short expiration of session. (Expire is not set
for cookie. This is not what you want probably, but this should not cause
expiration of cookie within 10 or 20 min. You changes session.cache_expire, but
set Expire: and no cache headers. I think you don't need to do
On Thursday 08 March 2001 07:17, you wrote:
> Does anybody know where I could get more info on storing session data
> in a database rather than the default way?
Hmm, perhaps phpbuilder.com has an article on it. Alternatively I could
send you some of my code
--
Christian Reiniger
LGDC Webmaster
Does anybody know where I could get more info on storing session data in a
database rather than the default way?
thanks
randy
-Original Message-
From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 12:58 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions
On Thursday 08 March 2001 03:45, you wrote:
> Is there a way as a server admin to kill all sessions to a site. I
> need a way to logout all members to a site.
Well, usually you'd keep the session data in a database, so you can just
empty the sessioninfo table.
--
Christian Reiniger
LGDC Webma
> Then how about check the server's response headers that sent to client? You
> can view headers using wget or like. PHP might be sending global ini
> var(which is set to small number) to client for some reason.
Ok, this is the header information I get.
HTTP/1.1 200 OK
Date: Thu, 08 Mar 2001 11
> On Thursday 08 March 2001 11:14, Yasuo Ohgaki wrote:
> > I guess your clients PC's clock is not accurate. How about set timeout
to
> > 0? Then session cookie will not timeout until browser is closed.
>
> Actually the server and client clock only differs with about 1 minute.
Then how about check
On Thursday 08 March 2001 11:14, Yasuo Ohgaki wrote:
> I guess your clients PC's clock is not accurate. How about set timeout to
> 0? Then session cookie will not timeout until browser is closed.
Actually the server and client clock only differs with about 1 minute.
The 0 timeout will not work.
I guess your clients PC's clock is not accurate. How about set timeout to 0?
Then session cookie will not timeout until browser is closed.
You can compile PHP with trans-sid to add session id automatically.
http://www.php.net/manual/en/ref.session.php
I've posted PHP session helper HTML file tha
You probably need to "unset" the cookie PHP is using to store the session ID
when you destroy the session.
Change your cookie handling in your browser to the "warn me before every
cookie" and play around a bit maybe.
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like
PHP does it automatically for you.
YES your session id is $PHPSESSID
so creating a file called $PHPSESSID should work, I suppose
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-Original Message-
F
Mensaje citado por: Brandon Orther <[EMAIL PROTECTED]>:
> Hello,
>
> Is there a way to start a session and then save a temp file with the
> name of
> the Session ID?
I thought that was what it did. :-)
Read the session manual, the papers published in phpbuilder and check the
session options in
At 19:55 22.02.2001, Brandon Orther said:
[snip]
>Is there a way to start a session and then save a temp file with the name of
>the Session ID?
[snip]
RTFM:
session_start();
session_register();
Controlled by
://www.calevans.com
-Original Message-
From: jeremy brand [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 11:46 AM
To: Kevin Beckford
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] sessions and objects
Don't store your object in the session, that is just bad design.
Store a lookup value,
Don't store your object in the session, that is just bad design.
Store a lookup value, then grab your object from your DB only when you
need it.
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
- - - - -
"Martin A. Marques" escribió:
> Mensaje citado por: Evelio Martinez <[EMAIL PROTECTED]>:
>
> >
> > Hi!
> >
> > is there any relation between use of sessions (php 4.0.4) and the
> > following browser message ?
> >
> > Data Missing
> >
> > This document resulted from a POST operation and has expir
Mensaje citado por: Evelio Martinez <[EMAIL PROTECTED]>:
>
> Hi!
>
> is there any relation between use of sessions (php 4.0.4) and the
> following browser message ?
>
> Data Missing
>
> This document resulted from a POST operation and has expired from the
> cache. If you wish you can repost
try it.
(yes you need to register it as a global variable)
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-Original Message-
From: John Vanderbeck [mailto:[EMAIL PROTECTED]]
Sent: Saturday, Febru
> I have an interesting problem with sessions (using enable-trans-sid).
>
> I have created a page with the following javascript function on it:
>
> function swapImgRestore() {
> var i,x,a=document.sr; for(i=0;a&&i x.src=x.oSrc;
> }
>
> However when I disable browser cookies the code is altered b
There are two ways of doing sessions, only two
cookies and ugly urls.
it doesnt matter if your crossing 8 domain names, or sticking to one, there
are only two options.
Are these domain names on the same server? yes? great then we can work with
this. you'll have to either disable cookies (cookie
On Tuesday 06 February 2001 19:39, Conover, Ryan wrote:
> If I save an object as a session var. will I still have access to its
> methods.
Yes, at least with PHP4. I'm doing that all the time.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for
> How can you get something like:
>
> header ("Location: $PHP_SELF?");
>
> to redirect with the sessid in the url? In my tests, it redirects, but
> does not append the sessid.
>
> I have compiled with --enable-trans-sid. Transparent sid is working, I
> can use it on links like:
>
> ">
>
> and it w
When you define the index.php and load the frames go ahead and start the
session and then pass the variables to the frame like this:
and then on main.php if you echo $var1 it will it will print "test"
Good Luck!
.:: Nathan Cook [ [EMAIL PROTECTED] ] ::.
Systems & Network Administrator :: Pro
The number of variables you are using probably won't make much of an impact
on performance. You may want to test doing it both ways, you can use the
gettimeofday function to do function profiling, it will return the time with
microsecond accuracy. I'm guessing one call to the database at the sta
>I'm exploring sessions in PHP4 as I build a new site, and I have decided to
rely on them more heavily than in the past.
>
>Basically, I'd like to set things up so that when someone logs into the
site, all of their accounts variables are queried from a >database and
loaded into session variables (
Hello Matthew,
(MD == "Matthew Delmarter") [EMAIL PROTECTED] steered:
MD> 1. Using arrays stored in a PHP4 session vs. a database for
MD> storing cart details.
Bad idea, if you're dealing with cookies, as any user can manipulate
the data on the client side and have your server gleefully accep
> Would there be any point in using php sessions if you aren't using
cookies?
> You have to store login info anyway, why not just use a temp table to
store
> transaction info and write to the database at the end of a session? From
> what I've read on sessions, you have to use cookies
> thanks
You
if yours only storeing one or two variables in a db, dont mind writing
either functions to store all this in the db, or having 5-10 lines of code
per page to this then fine. But sessions are so simple...
three lines of code, I can store text, arrays, class's all in three lines of
code, four if
David Tandberg-Johansen wrote:
>
> Hello!
>
> Could anyone give me an direction where I can find information something
> like "session for dummies"!
> It's not funny anymore. I don't have anymore hair left :-]
http://www.zend.com/zend/tut/session.php
--
Pavel a.k.a. Papi
--
PHP General
> Try looking at register_shutdown_function at
> http://www.php.net/manual/en/function.register-shutdown-function.php
>From the documentation:
"int register_shutdown_function (string func)
Registers the function named by func to be executed when script processing
is complete."
What qualifies a
I've read something on PHPBuilder.com.
look through the past articles
Cheers,
Maxim Maletsky
-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 17, 2000 2:46 AM
To: PHP User Group
Subject: [PHP] Sessions
Does anyone have a place with a little m
Fortunately I've recently done some research into this - here
are a few links to get you going:
http://www.phpwizard.net/resources/tutorials/session_intro.html
http://www.zend.com/zend/tut/session.php
and here are more links if you are interested in storing your
session info in a database - thes
Randy Johnson [[EMAIL PROTECTED]] wrote:
> Hello,
>
> I was going to use sessions to save a logged in variable so if the user
> logged in with a username and password I checked for the session variable
> and if it existed then I could continue.
>
> Is there a way for the loggedin session variabl
> These are the 3 files I'm using; they all reside in the same dir:
>
> The PHPSESSID variable is *not* being passed on
> the url going between page1 and page 2 and the
> session id is always different (obviously).
> --enable-trans-sid IS turned on and I have no idea
> what's going on...
When
> make sure of course too that session_start() is called from
> in your code too. else your not using sessions :)
These are the 3 files I'm using; they all reside in the same dir:
"index.php"
session_start();
header( "location: page1.php?" . SID );
exit();
"page1.php
sessio
> "allow per session cookies(not stored)" will enable cookies,
> IE just does some garbage collection when its closed thats all.
> so php realizes that IE is accepting cookies in this case and
> uses cookies vs trans-sid.
Ok. Makes sense.
However, when this option is enabled, I see PHPSESSI
"allow per session cookies(not stored)" will enable cookies, IE just does
some garbage collection when its closed thats all. so php realizes that IE
is accepting cookies in this case and uses cookies vs trans-sid. disable all
cookies in IE, and restart. goto the page your testing, you should see t
> I am interested in logging people in against a MySQL database, and
then
> storing temporary session data about them that would include anonymity
> stats, permissions, and variable tracking from page to page in a MySQL
> Database. (As opposed to insecure POST/GET/Cookie methods).
I'm a trifl
Brandon Orther wrote:
> Hello does anyone know why I get this error when I use this code?
>
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown on
line 0
Do what this error says to do, unless you have
It's using the path for unix to save the sessions, and it looks like you're
on windows. Look for the path directive in the php.ini file and change it
so only the windows path to the sessions save directory is there.
-
Jonathan Rosen
1001 - 1071 of 1071 matches
Mail list logo