Solved

PHP session variable & PHPSESSID

Posted on 2004-08-24
7
311 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
ID: 11879900
0
 
LVL 18

Expert Comment

by:CrYpTiC_MauleR
ID: 11879909
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
ID: 11879915
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
ID: 12531434
splitpoints CrYpTiC_MauleR and hernst42
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

679 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