Start session with javascript

I have a weird one, how would be the best way to start a session with javascript? i was thinking i could always make an iframe and start a session with php from there. That would be a little hacky, but it would work, any better options?

working on an ajax login system;)