473,788 Members | 3,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with session variables

hello,
I am finding that setting session variables is very unreliable (for
me).

Am I doing something wrong with syntax :
$contnum = getrequest("ID1 ") ; (ID1 is passed in the URL)
$_SESSION['sess_contnum']= $contnum ;

My program will randomly start to fail.
If I echo $sess_contnum, sometimes it is set, sometimes not.

I am using Apache 2.0.53 as a web server. Are there any parameters I
should be aware of (more memory allocated for SV's or ?).

thanks for any help!

Oct 11 '05 #1
4 1378
Japhy wrote:
hello,
I am finding that setting session variables is very unreliable (for
me).

Am I doing something wrong with syntax :
$contnum = getrequest("ID1 ") ; (ID1 is passed in the URL)
$_SESSION['sess_contnum']= $contnum ;

My program will randomly start to fail.
If I echo $sess_contnum, sometimes it is set, sometimes not.

I am using Apache 2.0.53 as a web server. Are there any parameters I
should be aware of (more memory allocated for SV's or ?).

thanks for any help!


Japhy,

Are you calling session_start() at the *beginning of every page* which
uses sessions?

This *must* be done before *any* output is sent to the browser if you're
using cookie based sessions.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Oct 11 '05 #2
Yes, I am....thanks for the thought

Oct 11 '05 #3
Japhy said the following on 11/10/2005 19:42:
hello,
I am finding that setting session variables is very unreliable (for
me).

Am I doing something wrong with syntax :
$contnum = getrequest("ID1 ") ; (ID1 is passed in the URL)
$_SESSION['sess_contnum']= $contnum ;

My program will randomly start to fail.
If I echo $sess_contnum, sometimes it is set, sometimes not.


You shouldn't be using $x to access $_SESSION['x']. See
http://www.php.net/manual/security.globals.php#AEN6744

--
Oli
Oct 11 '05 #4
Thanks. That helped me solve my 'reliability' problem, and as stated,
is more secure.

Oct 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1762
by: Marc Hoeve | last post by:
Hi everybody I'm setting up 2 websites for a friend of mine, en I'm have problems with one of the sites. The situation: I have 2 different domains (both in the .NL domain). Both domains provides the possibility for users to log in. The loginscript and the databases are hosted at server 1. The site at server 2 contains a link to the loginpage at server 1. That works well... so far.
2
1727
by: Jose Meireles | last post by:
Hi everyone, I'm trying to use public variables in a web form to hld specific values. What happens is that the public variables (declared as public x as y in the beginning of the class), doesn't seem to hold the value from function call to function call. Does anyone can help me abou this? best regards
4
1978
by: Phil Grimpo | last post by:
I had previously explained this problem in a different thread, but now that I have an IISState log, I figured I'd re-start the thred. My situation and the log are following... I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of these menus are then placed into the page by calling...
4
4630
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input type="checkbox" name="chk_Complete" value="<%Response.Write l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked"%>> The code to captures the checkbox value in the asp page that builds the sql string is follows
3
2638
by: Rob | last post by:
I'm trying to use session variables to store datasets when moving from page to page (and returning). The datasets are small (I know some may comment on performance issues). It seems simple to use. I can pass a dataset to the second page (once I get one additional page working, the rest will be simple) successfully but am not able to return to the default page and retrieve the dataset and rebind it to my datagrid. Once I store it as a...
3
1140
by: l-touched | last post by:
Hello, I am using authentication type = FORMS I need to use Session Variables for passing data between ASPX pages, but I have the following problem: If I call some page without doing athentification before, I will be redirected to Login.aspx, there in Login.aspx I assign (in Login.aspx.VB) this: Session("VARIABLE") = "SOMESTRING", after I will pass from this page to another page named BBB.aspx. In BBB.aspx I need to use (in...
4
1401
by: - Steve - | last post by:
I have a cs file I use in an ASP.NET form. The class has several member variables. If I assign a value to those variables in a method, when I get to another method the variable no longer equals what it was assigned. For example: namespace test { public class testClass : Page {
2
2292
by: John Mullin | last post by:
We are having a problem which appears similar to a previous posting: http://groups.google.com/groups?hl=en&lr=&frame=right&th=d97f552e10f8c94c&seekm=OZw33z9EDHA.2312%40TK2MSFTNGP10.phx.gbl#link1 In the current release of our system, we decided to "wrap" the ASP.NET Session and Application objects to improve code clarity and accuracy. For example, instead of: Session = new SomeListClass;
9
2442
by: jsale | last post by:
Hello, I am having a problem with multiple users using my asp.net application - namely that if each user clicks save at the same time, some, or all, of the users crash out. Do I need to do anything in particular to 'queue' their requests or should asp.net do this? Any help would be very useful, jsale
3
1392
by: Efrain Flores | last post by:
Hi I am experimenting session problems in ASP.NET. I am developing a data entry system composed of 3 different aspx pages. The values entered on the form fields are stored in sesion variables. These values are saved when the user presses the Next page button. This applies for the 3 pages. Once they are complete, I empty the values of the sessions into the database (Oracle). The users are telling me that some of the data is missing in...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.