473,414 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

session variable is not updating with new one session variable

50
Hi

I have script where $_SESSION['ID'] is assigned while login or registeration when i echo it will have some value but when call other pages then $_SESSION['ID'] is changed to something else (or the assigned way back )

example while login "ssid":"70fa1308537985b9ff46d565b89f480e",
even $_SESSION['ID'] is this
but
then call other file it has other $_SESSION['ID'] like
"1bbf5d2b93f99957e70eff17e05fe63d" but one's

i used $_SESSION['ID']= md5(microtime()); i try to use session_id() but even session_id() didn't change so used md5(microtime())

what i need is
i have URL like this
page1.php?action=login&loginMail=email@teamof.com& pass=1234 late assume
it will in post for just for testing i have given it in get method
gives json result like this {"success":"0","userid":"111","ssid":"ca3940cdbc0a 64c8d64b97fc8cc0f64e"}
this ssid obtained by assign value to $_SESION['ID']

page1.php?action=getcategory&uid=111&ssid=ca3940cd bc0a64c8d64b97fc8cc0f64e
{"success":"1"} bz when compare $_SESSION['ID']==$_REQUEST['ssid'] it gives other value
like this when i echoed it 1bbf5d2b93f99957e70eff17e05fe63d for $_SESSION['ID']

why this is happening first it assign's it then when comparing it with another call it will change

need some help plz
regards
Sach
Feb 16 '12 #1
2 2187
Dormilich
8,658 Expert Mod 8TB
i used $_SESSION['ID']= md5(microtime()); i try to use session_id() but even session_id() didn't change so used md5(microtime())
those two are completely unrelated. $_SESSION['ID'] is a value in your session while session_id() gets you the identifyer of your PHP session (so that you access the right set of data).

but without code this is hard to judge.
Feb 16 '12 #2
sidhx
50
hi Dormilich

im doing api for web and device.web side it gives different but works for device.
i know this $_SESSION['ID'] and session_id() is a different.
im say that one's i assign $_SESSION['ID'] to something as $_SESSION['ID']='123' then if i recheck that $_SESSION['ID'] from different response page it shows different value. i don't assign value here i just call $_SESSION['ID'] here.

when login i do this $_SESSION['ID']= md5(microtime());

then call other page with this variable $_SESSION['ID'] value changes its only ,if this file is accessed from different server, if i check this using url it works fine for device.
Feb 22 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Konrad | last post by:
After I register variable in session : session_start(); session_register($var); new page opens include("register2.php"); At the page I fill some forms and send variables from forms to...
2
by: Kench | last post by:
I was curious and playing with pointers and references to see what's different between them. Other than the obvious ones involving C++ syntax & things like references cannot be modified with...
4
by: John Kraft | last post by:
Hi all, My question is more of a phylisophical one here, but I am wondering what the difference is (effectively and performance wise) between using a shared variable/static variable and using a...
1
by: Joey Liang via DotNetMonster.com | last post by:
Hi all, Is it possible to store double variable to session? If possible can show me code sample on how to convert.Thanx n advance. -- Message posted via http://www.dotnetmonster.com
3
by: JJ_377 | last post by:
What is the difference between Session.Abandon and Session.Clear? Thank you.
10
by: Blaxer | last post by:
There is probably a really easy way to do this, so please forgive me but I would like to set the value of a variable from a variable, an example would be... function Calculate_Something(ByVal...
6
by: tshad | last post by:
Is there a reason to use session.remove over session.contents.remove? Don't they both remove the key and data from the contents collection? I assume that session(x) = nothing does essentially...
1
by: Nathan Sokalski | last post by:
Is there a difference between Session.Clear() and Session.RemoveAll()? The descriptions and documentation pages seem to say exactly the same thing, but I am assuming there must be some reason for...
37
by: minkoo.seo | last post by:
Hi. I've got a question on the differences and how to define static and class variables. AFAIK, class methods are the ones which receives the class itself as an argument, while static methods...
1
by: arsha123 | last post by:
How can I change the value of empty session variable with another variable value defined in form. I get value of session value of id from a logon form , that is "". I have defined a variable in form...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.