Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PHP session variable & PHPSESSID

Posted on 2004-08-24
7
306 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

860 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