Jump to content

losing session


bluetoother
 Share

Recommended Posts

i installed new web site on php (4) web serveri noticed that the server is adding variable to every link in the pagesthe variable is :PHPSESSID= (long random number)in the same time every one logged in got treated as guestafter short period of timebecause user who dont have session value will be treated as guests in the web sitehow to prevent the server from losing the SESSION values for the usersis there a need to add code sample from the pages ?

Link to comment
Share on other sites

thanks,, actually i cannot change the php.ini file because iam on a hosting serveri noticed another fatal error happens when there is more than one user in the site ,, when one of the online logged-in users add a post for example, the server insert a new record in the data base where i store the posts that contain the post text and the author ID which is the ID for the online user who posted the text, the server insert a record in the database with some other ID for another online usermy web site is new ,, and i tested it alone ,, not with other online users and this failure is killing my web siteiam using a hosting server / php 4 / Apachi 1.3

Link to comment
Share on other sites

Sounds like a problem, the user ID in the session isn't getting set to the right thing or the database statement isn't using the right ID. If you're using session cookies you shouldn't have users using the same sessions unless you have a 2-bit session ID or something like that.

Link to comment
Share on other sites

i discovered that user may got converted to be logged in using some other online user suddenly,,how ?from my computer i logged-in to the web site using my admin account on firefoxand logged-in with normal user account using IEthe normal account suddenly got converted to the admin accountwhen i run any sql command i run it this way:

INSERT INTO posts (post_text,author) VALUES ('$post_text','".$_SESSION['user_id']."')

when any user log-in , user will take 2 session values

$_SESSION['user_id']=$row['user_id'];// user id in the databse$_SESSION['user_group']=$row['user_group'];// user group in the databse

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...