Is it OK to have session_start as an include?
I have something like this:
// Session init
session_start();
function sKill() {
session_destroy();
session_unset();
header (Location: login.php);
exit();
}
function sInt() {
header (Location: login.php);
exit();
}
if
Paul Halliday wrote:
Is it OK to have session_start as an include?
Yes.
--
Per Jessen, Zürich (18.1°C)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
13:01:19 +0200
To: php-general@lists.php.net
Subject: Re: [PHP] Session question
Paul Halliday wrote:
Is it OK to have session_start as an include?
Yes.
--
Per Jessen, Zürich (18.1°C)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
Hansen [mailto:hansen.r...@live.com.au]
Sent: Tuesday, May 17, 2011 11:16 PM
To: php-general@lists.php.net
Subject: RE: [PHP] Session question
Unless your adding more code to your included file it isn't worth having it
as an include as there is more typing/text involved. For management purposes
Hi,
I have an index.php page which does not user session_start(); command.
However in this index.php page, there are some $_SESSION['...']; variables
stored.
How is it possible that $_SESSION['...']; works even if no session has been
created before ?
moreover, if i use a print Session ID :
the index.php page is the first page where user should logon.
it consists of 3 flags (english, french and slovak).
when use click on 1 flags, it reload the index.php page and changes the
login and password words by their relative translation into the flag country
selected.
if user click on LOGON
Alain Roger wrote:
the index.php page is the first page where user should logon.
it consists of 3 flags (english, french and slovak).
when use click on 1 flags, it reload the index.php page and changes the
login and password words by their relative translation into the flag
country
selected.
Hello,
Currently I have an app that handles connection from a machine with a built in
web browser. Commands from the remote on that machine are sent to the page via
javascript.(I am not sure how, maybe the machine has api's for the browser or
something)
The problem I am facing is the other
Hi,
I've looked at the php session documentation, and it doesn't look like
there's any way to run code when a session expires. I'd like to do some
cleanup when a user's session expires, is there any way to trap this?
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Tue, 7 Dec 2004 11:50:58 -0500, Josh Howe [EMAIL PROTECTED] wrote:
I've looked at the php session documentation, and it doesn't look like
there's any way to run code when a session expires. I'd like to do some
cleanup when a user's session expires, is there any way to trap this?
Thanks.
Hi, I've got a session problem that I don't understand.
Here's the setup. There are 2 frames, frame1 and frame2 (within frame1).
Frame1 is simply a static html page like the following:
frameset rows=0,* frameborder=NO border=0 framespacing=0
frame src=http://mysite.ca/blank.html;
What would cause the loss of a session in these circumstances:
php page with search form - session good
search form calls perl script
php page with search results - php wrapper for perl search form
displaying output - session good
php page gotten to from link on
How do you make a session time out?
and how do you make a session end if a person leaves your site?
Frank
__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To
session_destroy() I'm pretty sure, from what I've read.
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com
-Original Message-
From: Frank Tudor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 8:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] session
When a session is started on my server, it gets a name in the
sessiondata folder like:
sess_8sjg4893m9d0j43847dk4o5l2
I was just wondering if all sessions on ANY server start with sess_?
Is this a PHP-wide default, or can it be changed (not that I want to
change it, I just want to know if it
On 16-Jun-2003 Matt Palermo wrote:
When a session is started on my server, it gets a name in the
sessiondata folder like:
sess_8sjg4893m9d0j43847dk4o5l2
I was just wondering if all sessions on ANY server start with sess_?
Is this a PHP-wide default, or can it be changed (not that I
Hello Ernest,
SInce register_globals() is ON on my server, I need to be able to
figure out a way to ensure session security.
Another question I had was that, with register_globals() ON can I
still use the $_SESSION to set my variables ? I want to avoid recoding
the entire application, so I
in environments
where register_globals is disabled.
-Oorspronkelijk bericht-
Van: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Verzonden: Wednesday, May 28, 2003 6:18 PM
Aan: Ernest E Vogelsinger
CC: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] Session Question
Hello Ernest,
SInce
SInce register_globals() is ON on my server, I need to be able to
figure out a way to ensure session security.
The single most important thing to do is initialize all your variables. The
way to ensure that you have done that is to set the error reporting level to
E_ALL (which is max). The
Register globals essentially takes the value of $_SESSION['foo'] and creates
$foo. It does the same thing for GET, POST, COOKIES, etc.
The problem here is that you have no way of telling if $foo was a POST
variable, GET, SESSION, or whatever. So, I can choose to append ?admin=1 to
one of your
Hi All,
I have a question about sessions.
I need to pass session data from one domain to a secure domain. (www.mydomain.com to
www.securedomain.com).
I would like to preserve the session data in case the visitor goes back to
www.mydomain.com. I thought about just passing the session ID to
Hi,
A session is meant to exist on one domain... You could pass the session to
another domain to *hold* for you:
a href='https://secure.com/enter?oldSID=?=session_id();?'secure
checkout/a
Then the secure domain would be responsible for remembering the old session
id, and passing it back to
Hi,
I'm working on a project. It uses large sql data to create pages. Last week I
create some kind of cache info to create faster execution. It really works
(system runs more than 10 times faster)
But stroring cache data is problem. I use the session to store cache info.
With using cache data
Does php use cookies for sessions even if you don't explicitly use cookie
functions to save session data server side?
TIA,
Ed
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 11:10 AM
Subject: [PHP] Session Question
Does php use cookies for sessions even if you don't explicitly use cookie
functions to save session data server side?
TIA,
Ed
--
PHP General Mailing List (http://www.php.net
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Does php use cookies for sessions even if you don't explicitly use
cookie
functions to save session data server side?
--
That question doesn't even make sense to me -- cookie functions can't save
Sorry I didn't make myself more clear. I only want to use server side
sessions. I don't want to have to rely on a client having cookies enabled
in their browser. So far having trans_sid is just doing the trick. I can
save values into sessions server side and not explicitly create a client
side
I use both... and the way I see PHP handling it is like this...
First call in it will add the SESSID to the hrefs.
Next call (page load) if it finds the cookie it will not append SESSID to URL.
However if it doesn't it will.
There are a few instance were I need to get the SESSION ID and
Hello,
I'm a newbie in PHP, I use a lot ColdFusion (at work).
With ColdFusion, it's very easy to create and use session variable. I do
something like that :
cfset session.myvariable = hello and this variable can be use
everywhere.
Could you tell me how that's work in PHP. I saw in help file
versions, you just have to use session_register().
---John Holmes...
-Original Message-
From: Christian Ista [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 25, 2002 4:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Session question
Hello,
I'm a newbie in PHP, I use a lot ColdFusion
Just be sure you call session_start() on any page you want to access
session variables.
I have to call this function on each page I use session variable or juste
once ?
This assumes the latest version of PHP. The procedure is similar on
older versions, you just have to use
Just be sure you call session_start() on any page you want to access
session variables.
I have to call this function on each page I use session variable or juste
once ?
The statement is pretty clear. You've to call it once on each page you want
to access session variables.
This
I am trying to implement a user authentication/login system using PHP 4.x's
built in session functions. Upon a successful login, there is a
session_register('uid','uname','status'). On pages that require someone to
be an authenticated user I check against HTTP_SESSION_VARS['uid'] to make
sure
I am working on an open source e-commerce package and have hit a wall with
sessions.
If I have session.auto_start turned on, I get the following error message:
Fatal error: The script tried to execute a method or access a property of an
incomplete object. Please ensure that the class
You may want to check out something like auto_prepend_file. Look at the
PHP configuration help.
I was thinking that you may be able to include your class definition there
- IF auto_prepend_file IS INCLUDED BEFORE session.auto_start starts the
session.
Otherwise, use auto_prepend_file to
Hello,
I have implemented a user login with PHP Session functions.
THe problem I have is that if the user is logged in the
site using
http://mysite.com/login.php and starts a session, the
session is not recognized when user is trying to utilize
the site with
http://www.mysite.com/dosomething.php
I'm new to Apache (and PHP) and was unable to find anything approaching an
answer to this problem in the Apache documentation. In fact, I'm not even
sure if I'm having a problem with Apache or with PHP. I am trying to use
sessions to track users on my site and write information to a file. I'm not
Tom Malone pressed the little lettered thingies in this order...
I'm new to Apache (and PHP) and was unable to find anything approaching an
answer to this problem in the Apache documentation. In fact, I'm not even
sure if I'm having a problem with Apache or with PHP. I am trying to use
Thanks Christopher!
I chmoded the directory to 777 like you said, and it worked fine, but then I
took your advice regarding security and put all the data in a MySQL
database. Thank you very much for your help!
Tom Malone
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Warning:
fopen(/home/tgmalone/sessn-log/0bbaf33ab1c1f9d714e2244459979ec7.txt,a) -
Permission denied in /home/tgmalone/public_html/index.php on line 17
The problem is obvious, but I've been searching, searching and wracking my
inadequate brain for a solution and can't find one - can anyone
mean are the built in functions pretty effieicnt)? That is my primary
concern because of the # of usersthanks again!
-derick
- Original Message -
From: Peter Dudley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 21, 2001 8:47 AM
Subject: Re: [PHP] session question
Derick,
If you're seriously looking at thousands of concurent users
(let alone
millions) and the kind of budget on hardware and comms that
implies,
then I'd suggest you seriously look at your own session
solution with MySQL or
whatever.
You can perfectly easily just use your own
I am setting up a website with a need to use some
sort of session management for a large amount of users. I cannot use typical
file based session managment because at any given time there could be up
toa million users logged in at once. (It is a LAMP linux/apache/php4/mysql
system). I am a
There is a useful article here:
http://phpbuilder.com/columns/ying2602.php3?page=1
As to up to a million users logged in at once... don't you wantto have
multiple redundant web servers running under a load balancer? If the rest
of your system can handle that many concurrent users, then I
I have a question about session variables.
In my page the session variables are not seen by the pages where tem are not declared.
I´ve used session_register($variable) and so after at another page I´ve called echo
$variable; and it generate a message that the variable does not exists.
The
, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues
-Original Message-
From: Rodrigo Reis da Rocha [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 2:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP] session question
I have
I have a question about session variables.
In my page the session variables are not seen by the pages where tem are not declared.
I´ve used session_register(variable) and so after at another page I´ve called echo
$variable; and it generate a message that the variable does not exists.
The session
First use session_register(). Then give the variable a value.
So just rearrange your code, like this:
?php
session_start();
$SID = date("Y F j H:i:s");
session_register("SID"."fillista");
$fillista = "fillista.xml";
print "SID=".$SID;
?
That should do it.
--
Plutarck
Should be working on
Hi!
I am trying to learn about sessions and set up this file,
?
session_start();
$fillista = "fillista.xml";
session_register("SID"."fillista");
$SID = date("Y F j H:i:s");
print "SID=".$SID;
?
This seams not to work on the file fillista.xml, I can still read it
afterwords in IE:s cache.
I have a form that submits to abc.php which then calls db.php and db.php
then redirects to a new URL. I have session_start(); on all these files and
I'm registering the variables I need. It seems that the session dies or
gets lost on it's way through all the included files. I then tried to
some comments on sessions
- $PHPSESSID will only be set after the first page refresh.
- SID will only be set if your not using cookies.
- sessions with not transfer across multiple domain names.
- sessions without cookies will not transfer accross full urls.
?php
if (isset($PHPSESSID))
index.php where they log in from
?
session_start(); file://first line of file
Okay.
?
form method="POST" action="main.php"
input type="hidden" value="lrlogin" name="form_action"
Usernamenbsp;nbsp;input type="text" name="username" class="color"br
/
br/ ? You been typing too much
Hello Teodor,
Wednesday, January 31, 2001, 10:49:34 AM, you wrote:
TC Hi Mark!
TC On Wed, 31 Jan 2001, Mark Green wrote:
How about this:
session_start();
session_register($funky_session_var);
$funky_session_var ++;
print $funky_session_var;
TC the order doesn't matter (as it did in
Hi,
help: shouldn't this increase the number every time you reload the page?
session_start();
$funky_session_var ++;
session_register($funky_session_var);
print $funky_session_var;
Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
How about this:
session_start();
session_register($funky_session_var);
$funky_session_var ++;
print $funky_session_var;
Cheers,
^^@rk
Peter Van Dijck wrote:
Hi,
help: shouldn't this increase the number every time you reload the page?
session_start();
$funky_session_var ++;
Hi Mark!
On Wed, 31 Jan 2001, Mark Green wrote:
How about this:
session_start();
session_register($funky_session_var);
$funky_session_var ++;
print $funky_session_var;
the order doesn't matter (as it did in PHPLib sessions).
If it doesn't work I guess it's because you have
56 matches
Mail list logo