473,388 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

PHP Sessions Not working

Hello experts
i m a new one in PHP.i have developed an application and i m facing session problem.
session_start(); is obvious on everypage.
but wen i login after user validation where session varaibles are created the page is redirected by a header to the main page.but here i dont fine my session varibales
as in validating page
session_start();
$_session['a']="somthing";
and on the next page there is nothing in
$_session['a'] .
One thing i have noticed that on next page new session is created.
which is different from the previous page session id.
i m using php4.4.7 and register_global is on and session.use_trans_sid is off
session.auto_start is off and session.use_cookies is On.
i m working on it from last three days and it is the first time i m posting any thing on a forum.
and i m sure i'll get an appreciateable response.
Thanks
Sep 10 '07 #1
4 2535
Atli
5,058 Expert 4TB
Hi. Welcome to The Scripts!

First of all I would recommend turning register_globals Off. Enabling this is a security risk and is very likely to cause problems in the future.

Getting to your actual problem...

What platform is your server running on?
If it is Windows you will have to create a directory for the session data and set the 'session.save_path' to that directory. It is also very important that you give PHP permission to use that directory. (I usually give everyone full access to it)

If this doesn't help you, please post the code that is causing the problem and the code where you start the session.
Sep 11 '07 #2
momogi
28
If it is Windows you will have to create a directory for the session data and set the 'session.save_path' to that directory. It is also very important that you give PHP permission to use that directory. (I usually give everyone full access to it)
Hi Atli..

I wanna know how to configure php.ini in order to give PHP permission to access session.save_path's directory...
Looking forward to your answer... :)

--Thank You--
Sep 26 '07 #3
Atli
5,058 Expert 4TB
Hi momogi.

Folder permissions are not configured in php.ini.

To give PHP permission to a folder, you must give the user that is running the PHP service permission to use the folder. How that is done will depend on what operation system you are running.
Sep 27 '07 #4
momogi
28
Hi momogi.

Folder permissions are not configured in php.ini.

To give PHP permission to a folder, you must give the user that is running the PHP service permission to use the folder. How that is done will depend on what operation system you are running.
Oh.. I see...

Thank you Atli.. :)
Sep 28 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Chewy509 | last post by:
Hi Everyone, I'll just start, and say I am not a PHP developer (I'm a sysadmin, who has gotten lumped with a non-working website). But since I like to do this type of stuff, I though I might...
7
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere...
22
by: Theo | last post by:
Question for the group The authentication system for the site Im working on seems to function properly and all is good. A session keeps track of everything and a cookie is used to accept or deny...
3
by: Gary W | last post by:
Hello, I have used SESSIONS on mission critical pages on my site, and if sessions are not enabled / supoorted - these pages will fail. When and why would a session fail? They do not store any...
3
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a...
0
by: Jerad Rose | last post by:
I have an odd scenario. I am working on a hybrid site that uses various development platforms, namely traditional ASP and Lasso (a Mac scripting language). The site uses its own custom sessions...
2
by: PulsarSL | last post by:
Hey I have a WAMP setup (windows/apache/mysql/php). I'm running the latest version of all of them with a default installation of all of them. PHP works great with apache (as a module, not...
1
by: Duncan | last post by:
I have a strange problem with sessions in PHP 5. I have a simple script that prints a random number both as a string and a picture on the screen. When I run the script for the first time, it works...
2
abdoelmasry
by: abdoelmasry | last post by:
Hi all i have problem while using sessions i was working with php4 on apache with This Functions: session_start(); session_register("username"); $username="abdoelmasry"; it was working...
13
Frinavale
by: Frinavale | last post by:
One of the most fundamental topics in web design is understanding how to pass information collected on one web page to another web page. There are many different ways you could do this: Cookies,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.