Current location: Hot Scripts Forums » Programming Languages » PHP » passing sesison data to a SSL?


passing sesison data to a SSL?

Reply
  #1 (permalink)  
Old 04-29-07, 07:34 PM
phpdoctor's Avatar
phpdoctor phpdoctor is offline
Code Guru
 
Join Date: Feb 2007
Location: New Zealand
Posts: 767
Thanks: 4
Thanked 2 Times in 2 Posts
Question passing sesison data to a SSL?

Hay,

heres an example of my problem:
pages1.php (Not SSL)
PHP Code:

<?php


session_start
() ;
$_SESSION['session_one'] = 'hello' ;

?>
pages2.php (SSL)
PHP Code:

<?php


session_start
() ;
echo 
$_SESSION['session_one'] ;

?>
When I go from page1.php to page2.php it doesnt get the session created because it starts a new session, because the address is different?

I can send the session_id() by $_GET and can it on page2.php
BUT this is unsercure

Is there any other ways of going about this?
__________________
01010000 01001000 01010000
Reply With Quote
  #2 (permalink)  
Old 04-29-07, 09:06 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
There is a browser requirement that says that a session id (cookie) cannot be passed between a https and a http page. The reason is so that a session id that is created on a secure page won't ever be exchanged with the server through an unsecured connection, in case someone is monitoring/intercepting the data packets. As a result, browsers have separate http and https session caches and they won't send a session cookie created on one type of page to the other. The reason why it is not allowed to send a session id from a http page to a https one, is if someone has already intercepted the session id and you set some sensitive data on the https page, they would be able to access that information using the session id that has already been intercepted.

If your data is not that sensitive, the workaround is to pass the session id on the end of the URL and then do a session_start using that id.

The moral of the above, if you truly have sensitive data that you want to insure that no one has a chance of intercepting or accessing, only exchange the data and the session id through a https connection.

If you have less sensitive data that you want to pass, then store it in a database using a unique/random/use-one-time-then-destroy identifier and pass that identifier on the end of the URL.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 04-30-07, 07:29 PM
phpdoctor's Avatar
phpdoctor phpdoctor is offline
Code Guru
 
Join Date: Feb 2007
Location: New Zealand
Posts: 767
Thanks: 4
Thanked 2 Times in 2 Posts
Thanks for the help,
I will try your suggestion

Thanks again,
Lex
__________________
01010000 01001000 01010000
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Passing data between 2 functions. Nico JavaScript 2 03-31-06 02:20 AM
Pushing data to clients brokennb PHP 2 06-16-05 08:52 PM
Passing text vs numeric data as ID from one ASP page to another arobbo61 ASP 7 09-24-04 01:02 AM


All times are GMT -5. The time now is 06:02 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.