PDA

View Full Version : session id in hidden form input


The Keeper
04-01-2002, 10:13 AM
I want to submit the session id in a hidden input form field.
I've tried several variables, but they all lead me to a page with an invalid session error. I've even tried leaving it out.

This is not being done through a template, but through a php file.

What's the correct value?

Admin
04-01-2002, 10:22 AM
Basically in vB files the session hash is $session['sessionhash']. vB doesn't use PHP4's session handling do son't try using functions like session_id().

The Keeper
04-01-2002, 10:33 AM
yeah I tried that like

value=\"$session['sessionhash']\"

and

value='".$session['sessionhash']."'

but they both made invalid sessions

Admin
04-01-2002, 10:42 AM
What do you mean "invalid sessions"? What kind of error did you get?
BTW in the first line you don't need ' inside the [] brackets.

The Keeper
04-01-2002, 11:05 AM
The action you have attempted could not be performed as your session appears to be invalid. Click the below link to attempt this action again with a new session.
Try this action again!


Clicking 'try this action again' actually fixes it, but I would prefer to bypass the step

Admin
04-01-2002, 11:07 AM
Is the referring page part of vBulletin? i.e is the $session array available there?

The Keeper
04-01-2002, 12:34 PM
yes it's part of vbulletin (template: error_invalidsession)

I'm starting to think it's because the 'form' that is submitting is actually being included through php onto the main page.

maybe I need to specify a s=$session['sessionhash'] in the url of the include?

The Keeper
04-01-2002, 12:36 PM
oh but no, the script with the form on it is my own creation. I thought it would inherit the session id of the page it was being included on.