Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'

Tags:

php

session

How to solve :

Warning: session_start() [function.session-start]: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in ..... on line 3

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at ......:3) in ..... on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at .....:3) in ..... on line 3

like image 541
Nandini Bhaduri Avatar asked Jul 06 '10 11:07

Nandini Bhaduri


People also ask

What is the value of session ID?

A session ID is a unique number that a Web site's server assigns a specific user for the duration of that user's visit (session). The session ID can be stored as a cookie, form field, or URL (Uniform Resource Locator). Some Web servers generate session IDs by simply incrementing static numbers.

How do I get my session ID?

Session IDs are typically found in the Request (NCSA) field, the URI-Query (W3C), or the Cookie field: If the ID is found in the URL itself, it will be in the Request field for Apache servers and in the URI Query field for IIS servers.

Is session id sensitive?

Session IDs are sensitive information that may allow an attacker to steal, modify and/or destroy information once they obtain one. Information sent via URL parameters is: Stored in clear text in the browser history. Sent to external sites via the referrer HTTP header.

Can we change session ID?

Session id is generated by PHP at server end user can't change the generated session id. However it can be re-created. Here is the code.


1 Answers

It is an information vulnerability: a malicious attacker may alter the cookies and assign illegal characters to PHPSESSID to expose this PHP warning, which in fact contains juicy information like the file path and the username!

like image 81
EvilThinker Avatar answered Oct 07 '22 13:10

EvilThinker