Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-21-2011, 11:57 AM Two sessions problem
miki86's Avatar
Extreme Talker

Posts: 185
Location: print_r($serbia);
Trades: 0
Hello,

Im writing a user registration php code for an image hosting script which doesn't have one.
I have finished implementing database to that script and users can now log in.
I have a db table which im planing to use for storing image name, size, width...

Problem begins when logged user tries to upload image.
Script is written to generate it's own session, so i can't check if a user is logged in or not.
I now have two sessions.

I tried editing all files that use session_id(), but same thing happens, php page that calls upload class uses that other session. This is the page i need with my session so i can get the image data.

It's all under one domain, but it's like the script is written to rewrite it self and it's root dir to a different sub dir.

Can anyone tell me how is that possible, to have two different sessions under one domain.
And if you can give me a tip for what to look for.

Thank you in advance.
miki86 is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-21-2011, 04:10 PM Re: Two sessions problem
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I don't know if it's possible to have two seperate sessions in the same browser. Are you sure the image script isn't just overwriting/deleting your session variables? Check for usage of session_destroy() or session_unregister().
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 06-21-2011, 06:46 PM Re: Two sessions problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yep, session id's are unique to each browser and each browser can only have one session.

A session can hold many key/value pairs though.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-22-2011, 03:50 AM Re: Two sessions problem
miki86's Avatar
Extreme Talker

Posts: 185
Location: print_r($serbia);
Trades: 0
I was wrong.
There is only one session, but the script was using different id than i am, actually i didn't set the id at all, i just started a session.

Thats why i couldn't read it. The script was using $_COOKIE['PHPSESSID'] to set the id.

So i just added a quick check before starting a session on my pages and everything is working now.

Thanks for replaying.
miki86 is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to Two sessions problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13650 seconds with 12 queries