[Tutor] Help with generating session id

Luke Paireepinart rabidpoobear at gmail.com
Thu Oct 12 22:44:56 CEST 2006


anil maran wrote:
> Hi guys
> I m trying to maintain Sessions for each user, and a session-id that 
> needs to be stored in cookie. I m unable to figure out how to generate 
> session-id that can be stored in a cookie and sync with a session.
> The problem is this
> everytime someone logs in check and see if they have session info that 
> can be resumed or create a new session and store the session id in a 
> cookie. Atleast this is my understanding, how do we sync up sessions + 
> logins. Should I store the session id in a db.
> Thanks
> Anil
> Here is code I have worked on so far, does login with sessions no 
> cookies yet;)
You need to think through the logic of what you're trying to do.
Often, the logistics of how a specific algo will be implemented take 
more thought and planning than the actual programming of it.
We here are essentially a programming help forum, for people who don't 
have a problem coming up with an algorithm (the hard part)
but just in implementing it (the easy part).

So asking us 'how do I do x' is almost definitely not going to get the 
kind of answer you want.

Consider what you're seeking.  It's not up to us to design an 
implementation for you.
There are many different ways you can sync up logins, there are multiple 
ways to store the session-id on the server.
It's up to you to come up with which way you want to do it, and start 
implementing it, and then we assist you if you have basic programming 
problems.
If you want to know about session-ids, what they're supposed to do, how 
to generate them, how to use cookies... all of these questions
are questions you would get better help by asking on a Webmaster forum.

What problem are you having specifically?
can you generate the session-id?
can you make a cookie with the session-id on the user's computer?
can you check their cookie when they login with whatever method you're 
using to keep track of sessions on your server?

Also,
what does @checkaccess() do?
is this a placeholder?
what is flup? what is flup.middleware? what is flup.middleware.session?
Your code doesn't do anything, does it?
it's just a definition of a bunch of methods.
Is this a library you wrote?
What kind of advice are you looking to get from showing us this?

HTH,
-Luke



More information about the Tutor mailing list