Solved

PHP session variable & PHPSESSID

Posted on 2004-08-24
7
300 Views
Last Modified: 2008-03-17
Hi all, I am having an error in getting the session variable in php:

1. my application is a login page, if user successfully logged in, the user id will become sessioned and then he will be directed to the main page. I don't know why there are "?PHPSESSID=xxxxxxxx" in all URL of the main page...

I have tried some similar application in another server, but the PHPSESSID should not be shown... how can I make this invisible??

2. in each of the main page link, I redirect the user to a frame page, but it seems that the frameset cannot get the sessioned variable....I can only get the variable if I open another browser at the same time and login again...(in this double login case, I will not get "?PHPSESSID=xxxxxxxx" at the end of the main page link)

Hope someone can help, thanks
0
Comment
Question by:esther_6694
  • 2
  • 2
7 Comments
 
LVL 18

Accepted Solution

by:
CrYpTiC_MauleR earned 75 total points
Comment Utility
0
 
LVL 18

Expert Comment

by:CrYpTiC_MauleR
Comment Utility
what it does is it appends the session variable to each hyperlink ti see on the page. You can disable that for hyperlinks or you can switch to having session via cookies which dont require the session to be passed via anu URlL.

Regards,
Nick
0
 
LVL 48

Assisted Solution

by:hernst42
hernst42 earned 75 total points
Comment Utility
it looks like the session.use_trans_sid is enabled on your system. Then PHP adds that part if no cookie can be set.

; trans sid support is disabled by default.
; Use of trans sid may risk your users security.
; Use this option with caution.
; - User may send URL contains active session ID
;   to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
;   in publically accessible computer.
; - User may access your site with the same session ID
;   always using URL stored in browser's history or bookmarks.
session.use_trans_sid = 0

So disable session.use_trans_sid if it is enabled.
0
 
LVL 48

Expert Comment

by:hernst42
Comment Utility
splitpoints CrYpTiC_MauleR and hernst42
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now