We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,497 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

php iphone mobile web dev

Hi all, this is just a quick question with regards to php session data. . .

I have a php built website and I am trying to develop a mobile html / php website to connect to the desktop website.

I can enter my username / password / and secure code, but when ever I try and load the members area it seems the session data is being lost, and the session fails. So I am unable to login through my phone.

I have check, double checked and triple checked the session data variables and they are correct.

Can anyone help, or point me in the right direction

Cheers

2
Contributors
6
Replies
10 Hours
Discussion Span
1 Year Ago
Last Updated
7
Views
DaveyMoyes
Junior Poster
122 posts since May 2009
Reputation Points: 9
Solved Threads: 0
Skill Endorsements: 0

Create a php page to display cookies and session values and then open it with iphone and a desktop. This will help you to understand what is not working. Also check error and access log files in apache.

cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

Hi, many thanks for replying, Its strange as I can login to the website from the desktop m.website.com. . .

but when ever I try to login from my mobile, It's like it doesnt understand the session data. . .

DaveyMoyes
Junior Poster
122 posts since May 2009
Reputation Points: 9
Solved Threads: 0
Skill Endorsements: 0

Hi, could you show me how to start with creating cookies and integrating / reading from them into php. . .

I have three session variables ? Do i need to create a cookie for each variable I want to read from ?

How would I read the cookie variable ?

DaveyMoyes
Junior Poster
122 posts since May 2009
Reputation Points: 9
Solved Threads: 0
Skill Endorsements: 0

Here's what you can try:

<?php session_start(); ?>
<h3>Cookies</h3>
<pre>
<?php
print_r($_COOKIE);
?>
</pre>
<h3>Session</h3>
<pre>
<?php
print_r($_SESSION);
?>
</pre>

After your login go to this page and check if you get same variables or if something is missing, do this test with the iphone and desktop. I mentioned cookies because I didn't know if you used them or not. I can't help more than this without the code.

cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

Hi, thanks, Iw ill give this a go. I have never used cookies, only session data, im new to php and web design.

When a user enters username and password, it reads from the databse correctly and then sends securecode.php?id=$id (this is also working) as I get the correct id number.

Its just when I enter the securecode, if the code is correct, it will then take the user to the members area, where is reads from the session data and brings back user details from mysql.

The above is working great on the desktop.

DaveyMoyes
Junior Poster
122 posts since May 2009
Reputation Points: 9
Solved Threads: 0
Skill Endorsements: 0

Here is the responce from the file u said to upload from the desktop m.website.co.uk

Still unable to login through mobile tho ?

Cookies

    Array
(
    [__utma] => 67449875.1691414763.1322683205.1331604699.1331644165.360
    [__utmz] => 67449875.1331644165.360.38.utmcsr=m.website.co.uk|utmccn=(referral)|utmcmd=referral|utmcct=/directory/
    [__utmc] => 67449875
    [PHPSESSID] => 4dgt5bar5eg1h0np1aeebuhgg3
    [__utmb] => 104626524.3.10.1331649966
)
    

Session

    Array
(
    [SESS_MEMBER_ID] => 81
    [SESS_SECURE_CODE] => a15807d6cc5bd083512906f76b5ca744b25ef5b2
    [SESS_CREFF] => 59632273
)
DaveyMoyes
Junior Poster
122 posts since May 2009
Reputation Points: 9
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0732 seconds using 2.66MB