try this (I think you have register_globals turned off)
Page 2:
?
print $_SESSION['test_var'].!;
?
Alexander Ross wrote:
I'm trying to understand sessions so I can set session variables. I set up 2
very simple pages:
Page 1:
?
session_start();
$test_var = froggy;
This really is like life, PHP Sessions aren't particularly secure, just make
a form to post PHPSESSID of a true session to one of ya pages and you can
steal a session!
Its possible to check IPs and so on,
PHP's sessions use text files (by default), and pre-populate
$_SESSION/$HTTP_SESSION_VARS.
Javascript cannot interact with PHP. You have to realise that the PHP
code has been already executed long before the javascript gets a chance to.
Mike
Morten Nielsen wrote:
Hi,
I got a php and a javascript page. In the PHP page I register a SESSION call
'info'. I would then like to put a
You should use session_start(); on every page that u want to pass session
information..
Craig
Jeff Lewis [EMAIL PROTECTED] wrote in message
00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT">news:00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT...
I am storing session information by using $_SESSION[privs] and
Donnelly [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 9:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Sessions not staying a session...
You should use session_start(); on every page that u want to pass session
information..
Craig
Jeff Lewis [EMAIL PROTECTED] wrote in message
I was under the assumption that it did...I have aded session_start and it
still doesn't work.
Jeff
- Original Message -
From: Vail, Warren [EMAIL PROTECTED]
To: 'Craig Donnelly' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, April 25, 2002 12:04 PM
Subject: RE: [PHP] Re: Sessions
That would be easier. fopen the session file and store the information on
a database. Later you just fwrite the contents to a new file.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
Julio Nobrega Trabalhando wrote:
That would be easier. fopen the session file and store the information on
a database. Later you just fwrite the contents to a new file.
I don't use PHP4 sessions since I cook my own, but I think the
above won't work. My guess is that if you read the file,
Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a
newer version?
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
Steve Fitzgerald
Cookies it was. Thanks
Julio Nobrega Trabalhando wrote:
Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a
newer version?
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
PM
Subject: [PHP] Re: Sessions and Opera
Cookies it was. Thanks
Julio Nobrega Trabalhando wrote:
Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or
a
newer version?
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei
sure. if all users should have access to this instance of your object, then
you could store the serialized object in a file,
everyone has access to and unserialize it if needed.But don't forget to
include your object-surcecode
before unserializing the object, or you'll lose your methods. If users
Michael Virnstein wrote:
you also have to make sure, that only one user can access the file for
writing at one time, or your data gets probably
screwed. The easiest way would be storing the object not in a file but in a
database, so you don't have to care about locking.
Tnx for the help, and
okay i'll explain a bit
i want my sessions to store some values but instead of storing them their
doing nothing at all here's some code
// beginning of registering of values
session_start();
session_register(fu);
session_register(bar);
$fu=fu;
$bar =bar;
// end of registering
On Thursday 04 April 2002 01:04, R. Lindeman wrote:
okay i'll explain a bit
i want my sessions to store some values but instead of storing them their
doing nothing at all here's some code
// beginning of registering of values
session_start();
session_register(fu);
On Wednesday 03 April 2002 04:19, Jason Wong wrote:
On Thursday 04 April 2002 01:04, R. Lindeman wrote:
okay i'll explain a bit
i want my sessions to store some values but instead of storing them their
doing nothing at all here's some code
// beginning of registering of values
Just as a note, recent builds of Mozilla have a cookie manager that is
the best for seeing exactly what's going on with your cookies. You
can list by name or host and see all the properties of each. Know
when your session cookies are sent/deleted, know if PHP is allowing
use of the same SESSID
Steve Clay wrote:
Hello,
I'm building an e-commerce site which uses sessions to
hold my $cart object. This works great but I've two worries:
1) When the user connects through our secure hostname, can I ensure
the browser will send the server the cookie (w/ SESSID)? The user
will
I haven't experienced this myself, but I'd have thought that if you're
propagating the session via the URL rather than a cookie then it won't get
added if the page isn't parsed. If it's not passed on just once it's lost.
Tim Ward
Internet chess www.chessish.com http://www.chessish.com
Not passing via URL currently... using track_vars
Dave
-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 4:16 AM
To: [EMAIL PROTECTED]; Dave
Subject: [PHP] RE: Sessions and switching between php and htm documents
I haven't experienced
When you check your info page, do sessions automatically start? If not, make
sure you do a session_start(); in there somewhere before you start checking
things.
Not sure why (lost in the annuls of time) but I always manually start/stop
my sessions.
=C=
*
* Cal Evans
* Journeyman Programmer
*
I think changing a setting in php.ini will do it, I'm just not sure
which one. session.cache_expire seems like it might do something, or
maybe session.gc_maxlifetime. Look them up in the manual
-Original Message-
From: Nigel Gilbert [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February
Hi Justin, are you using ?php session_start(); ? at the top of every page
you want to keep the session?
Cheers, Joe :)
Justin Deutsch [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi All,
I am running Apache with PHP4 as a module. I have also written a
Hi Nigel, you could set a cookie once they enter your site, and check at the
top of each page you want accessible with this variable to see if they have
it or not.
Joe :)
Nigel Gilbert [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
By default, a session
Norman Cates wrote:
I cannot get session information to work under any circumstances
SNIP
But even reading the comments on the above page, nothing will work. It will
not persist with the session variable...
Am I doing something wrong?
If you are using recent PHP, track vars are
Try to enable output bufffering to see if it helps.
--
Yasuo Ohgaki
Please CC me when you reply to news/list messages.
Do not reply only to me :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
From my understanding, as long as you have a session_start() function
above the html tag, you can work with variables in the form
$_SESSION['variableName'] rather than having to use session_register().
In fact, using session_register() is no longer needed at all. Use
Jeff Sheltren wrote:
What happens if you set register_globals=Off and use
$_SESSION?
Thanks for the reply. I will try changing register_globals to Off. I am
not quite sure I know what you mean by using $_SESSION though, could someone
please explain how that is uesd?
Session manaul pages
By design. Try accessing $HTTP_SESSION_VARS instead. That should work. In
other words, if you were accessing a session variable by $session_var, now
use $HTTP_SESSION_VARS['session_var'].
--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v2.6 Guest Book
Thanks, that worked fined!
On Mon, 24 Dec 2001 09:31:31 -0600
Gaylen Fraley [EMAIL PROTECTED] wrote:
By design. Try accessing $HTTP_SESSION_VARS instead. That should work. In
other words, if you were accessing a session variable by $session_var, now
use $HTTP_SESSION_VARS['session_var'].
insted of
if ( $isloggedin )
user logged in
do
if ( $HTTP_SESSION_VARS['isloggedin'] )
user is logged in
--
Chris Lee
[EMAIL PROTECTED]
Steve Maroney [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hey guys,
I know this has been brought up
take a look at my session.egn file.
http://www.mediawaveonline.com/examples/
--
Chris Lee
[EMAIL PROTECTED]
Anthony [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I need some help with sessions. I read the sections in the manual and
searched for
is your web server a Microsoft one (IIS, PWS, ...) ?
I'm not sure, but I think there is a known problem with them if you set a
session variable and do a redirect in the same page.
Can anyone confirm this ?
Philippe
Karina Gómez Salgado [EMAIL PROTECTED] a écrit dans le message news:
[EMAIL
Nope.
Still doesn't work.
I still have to do a refresh on the page manually...
Any other ideas?
Thanks,
Brad
-Original Message-
From: Wayne K [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 2 October 2001 11:38 AM
To: Bradley Goldsmith
Subject: Re: Sessions, sessions, sessions...
]
Sent: Saturday, September 22, 2001 4:38 PM
Subject: RE: [PHP] Re: Sessions and include()...
Alright. If that's the case, how do you make sure a cookie gets set for
the remote domain? I'm working on a project to write a hosted shopping
cart, but we want people to have the ability to include
pieces would need to use the same session as if they were on
/our/ server.
-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 21, 2001 10:25 PM
To: Matthew Walker
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: Sessions and include()...
I believe:
include
I believe:
include() gets parsed and executed on the server that is doing the
include-ing, not the remote server...
If that file has session_xxx() in it, you'll have started a session and
whatnot on the local server.
The remote server doesn't even have to have PHP on it at all, and its
Maybe it's getting timed out?
Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have a database update system and I regonize users with sessions.
Sometimes sessions just broke with no sane (for me at least) reason.
Any ideas what may cause this,
: _lallous [mailto:[EMAIL PROTECTED]]
Sent: 11. syyskuuta 2001 13:09
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Sessions Getting Broken
Maybe it's getting timed out?
Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have a database update syst
it thou.
session.cache_expire is set to 180.
session.cookie_lifetime is 0.
Maybe those do tell you something and you tell me more! :)
Niklas
-Original Message-
From: _lallous [mailto:[EMAIL PROTECTED]]
Sent: 11. syyskuuta 2001 13:09
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Sessions
page with an error
code.
Niklas
-Original Message-
From: _lallous [mailto:[EMAIL PROTECTED]]
Sent: 11. syyskuuta 2001 14:35
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Sessions Getting Broken
Can't tell like that
No more ideasmaybe somecode would help?!
Niklas lampén [EMAIL
this allways buggers people up
session_register(count);
$count = array();
should be
$count = array();
session_register(count);
you have to set the var first before registering it. you should also check
if the var is allready registerd ($HTTP_SESSION_VARS[]) if so, dont
another question is, at what time of the script does php call my
session_write function to update the registered session?!
*AFTER* the connection to the browser is dead and gone, so any error output
is sent to the twilight zone.
Any error output in session_write needs to go through error_log
If Cookies are off, you may need to provide more than just # as the HREF.
While # will work, it's not technically speaking a valid URL, and PHP is
probably not inserting the SID into the URL, or else inserting it in the
wrong place.
Use View Source in your browser to see what PHP is doing to
Show us source code.
Test your site in IE 4.0 and set preferences to notify me before accepting
cookies
See what you get for cookies, and what IE stores, and what comes back to
your PHP code.
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me
great minds and all that
this is some code i use but i have a login page that takes the username and
passowrd and passes that to another page that does the verification.
so:
page 1 takes the username and password.
page 2 registers session vars and sets logged in to true if accepted.
every
For who knows about bugs with session in PHP, I have:
PHP Version 4.0.4pl1
Marian [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have a problem with session thing. I have one script for logging into
some
user pages. But many users tell me that the script is...
101 - 147 of 147 matches
Mail list logo